Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I'm not sure why the following is giving me a PatternSyntaxException:
PatternSyntaxException
Pattern regex = Pattern.compile("\\[[12|\\[|\\|\\||\\^\\^|\\^|\\_|\\_\\_|\\=|abcdefgABCDEFG|\\|");
It claims the error is at |a which I don't really understand.
|a
I don't see a matching ']' to the one that isn't escaped...
Pattern regex = Pattern.compile("\\[[12|... |This one
Add a comment
Are the characters inside the unescaped pipes supped to be a character range? Of so, they should be in square brackets.
[A-Ga-g]
It's an error because the pipe character is a regex logical operator (or).
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.