正则的
Pattern pattern = Pattern.compile("(?<=[a-zA-Z])");
Matcher matcher = pattern.matcher(modelStr);
while (matcher.find()) {
index = matcher.start();//找到匹配的位置
}
| 宽断言 | (?=exp) | 匹配exp前面的位置 |
|---|---|---|
| (?<=exp) | 匹配exp后面的位置 | |
| (?!exp) | 匹配后面跟的不是exp的位置 | |
| (?<!exp) | 匹配前面不是exp的位置 |

浙公网安备 33010602011771号