正则表达式求教
将字符串 the boy plays the good games 在the和good处分割
String str = "the boy plays the good games ";
str.split("regex"),不知道这个regex该怎么写
我要的效果是[the,boy plays the,good,games]
[解决办法]
str.split("(?<=the)\\s
[解决办法]
(?<=good)\\s");
[解决办法]
(?<=(the
[解决办法]
good)\\s+)
[解决办法]
String str = "the boy plays the good games ";
String[] strs=str.split("(?<=the)\\b+");
System.out.println(Arrays.toString(strs));