标签: java regex string split
我正在尝试使用带有关系运算符(<,<=,>=,>,!=,=)的正则表达式将字符串拆分为分隔符,同时保留运算符。
(<,<=,>=,>,!=,=)
例如分割后的string query firstName>A and firstName <= C:
string query firstName>A and firstName <= C
string[1] query firstName string[2] > string[3] A and firstName string[4] <= string[5] C
.split("(?=[<>=!])");离我最近
.split("(?=[<>=!])");