Studyon Minte9.com
Regexp




replaceAll



	%java
		Pattern pat = Pattern.compile("Jon.*? ");
                          // find Jon; zero or more characters; space
		Matcher mat = pat.matcher("Jon Jonathan Frank Ken Todd");
		
		while(mat.find()) {
		    System.out.println(mat.replaceAll("Eric "));
			// Eric  Eric athan Frank Ken Todd
		}

	%java
		String s = "{message_info={message_type=trade_feed|timestamp=11}|error=0}";
		s = s.replaceAll("([^={}|]+)=", "\"$1\"=");
		s = s.replaceAll("=([^={}|]+)", "=\"$1\"");
		s = s.replaceAll("=", ":");
		s = s.replaceAll("\\|", ",");
		System.out.println(s);
			// Output: 
			// {"message_info":{"message_type":"trade_feed","timestamp":"11"},"error":"0"}