I'm currently using this regex pattern = "(?ius)[(?<=\\s)]\\bgo\\b(?=\\s)".
The purpose if to filter t-sql commands with the "go" as a delimiter.
Example t-sql code:
select * from table1 go
select * from table2
go select * from table3
The pattern works with the split() method, but it does not work with the find() method.
Example result with split() method:
select * from table1
select * from table2
select * from table3
Example result with find() method:
select * from table1 go
select * from table2
go select * from table3
It seams to have a problem when the "go" is at the end of the line or at the beginning. If the first "go" had a space after it, it works. I've already tried several things without any luck. In my case I really need to use the find() method, I can't just rely on split, because I need confirmation that the a "line" as a delimiter before doing the split.
matches()instead ofmatcher(), but now I'm not sure that was right. Can you show the actual code you're using?matcher()method just creates a Matcher object so you can call itsfind()method, so you don't need to mention it.