I want to match string ending with \')\' . I use pattern :
\"[)]\\b\" or \".*[)]\\b\"
It should match the string :
x=main2
The \b only matches a position at a word boundary. Think of it as a (^\w|\w$|\W\w|\w\W) where \w is any alphanumeric character and \W is any non-alphanumeric character. The parenthesis is non-alphanumeric so won't be matched by \b.
Just match a parethesis, followed by the end of the string by using \)$