How to use a regex to search backwards effectively?

后端 未结 5 960
温柔的废话
温柔的废话 2020-12-18 22:51

I\'m searching forward in an array of strings with a regex, like this:

for (int j = line; j < lines.length; j++) {  
    if (lines[j] == null || lines[j].         


        
5条回答
  •  太阳男子
    2020-12-18 23:17

    Is the search string strictly a regex (full, rich syntax?) Because if not, for(int j = line; j >= 0 ; j--), reverse the line, reverse the match and search forward ;)

提交回复
热议问题