Java regular expression Neighborhoods

Category: Java Related
2009-05-17 08:26:47

Sponsored Links
Take the following regular expression string [very good, it should be genuine]
neighborhoods how to write regular expressions, thank you very much!

string as follows:
rateContent ":" very good, it should be genuine "," rateDate

Sponsored Links

2009-05-17 08:45:46
string both before and after payment Such Mody split (") on the line it
2009-05-17 08:57:04
From one seen rateContent": "very good, it should be genuine", "rateDate
seemingly rule is to take rateContent" ;: "and", "rateDate middle of that part.

in java double quotes to escape it, so you can write strings
String s = "rateContent \": \ "very good, it should be genuine \", \ "rateDate";
that corresponding regular can be written as:

String s = "rateContent\":\" , \",\"rateDate";		
Pattern p = Pattern.compile("rateContent\":\"(.*)\",\"rateDate");
Matcher m  = p.matcher(s);
2009-05-17 09:04:49
ask under Kazakhstan, to obtain the following expression string 79 how to write it?

4.6 stars | 79 evaluations
2009-05-17 09:21:28

direct interception of String substring function on the line
2009-05-17 09:27:03

String str = "4.6 |79 ";
Pattern p = Pattern.compile("\\|(\\d+)");
Matcher matcher = p.matcher(str);
while (matcher.find()) {
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.