I want to match string ending with ')' . I use pattern :
"[)]" or ".*[)]"
It should match the string :
x=main2.addMenu('Edit')
But it doesn't work. What is wrong ?
The only matches a position at a word boundary. Think of it as a (^w|w$|Ww|wW) where w is any alphanumeric character and W is any non-alphanumeric character. The parenthesis is non-alphanumeric so won't be matched by .
(^w|w$|Ww|wW)
Just match a parethesis, followed by the end of the string by using )$
)$
2.1m questions
2.1m answers
60 comments
57.0k users