正则表达式截取字符串的问题
afasd xxx=100 asfasdfasdf
easdi9 xxx= "200 " n8erer
n xxx=3 nie3
z vd xxx=150
....
查找所有的xxx=x 的字串,如果x> 110 则替换为xxx=888否则不换
结果为:
afasd xxx=100 asfasdfasdf
easdi9 xxx=888 n8erer
n xxx=3 nie3
z vd xxx=888
....
[解决办法]
String str2 = "afasd xxx=100 asfasdfasdf ";
System.out.println(
str2.replaceFirst( "(? <=xxx\\=)(11[1-9]|1[2-9]\\d|[2-9]\\d{2}|[1-9]\\d{3,}) ", "888 "));
------------------------------------
好乱,呵呵.将就着使吧.