I am trying to use the following regex pattern B@(@?w+(?:::w+)?)([ ]*)(( ( (?>[^()]+) | (?3) )* ))?
using java.util.regex.Pattern
but I keep getting the error Unknown inline modifier near index 49 B@(@?w+(?:::w+)?)([ ]*)(( ( (?>[^()]+) | (?3) )* ))? ^
I have tried to escape the regex pattern using the character at the index it is complaining about but it still fails. Hoping someone here can help me get this working.
This is the test string I am trying to use it against:
Value @if(blah == 1) 'assigned' @else 'reassigned' @endif from boom to blah
If I put the pattern into the website regex 101 it works fine.
See Question&Answers more detail:os