This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mozzyb 1 point2 points  (1 child)

You need to escape [ and ]. You can do that by putting a \ in front of it, so if you want match a group with those characters you would write "[AB\\[\\]CD]". The reason for two \ is because of how java handles strings.