I have this string This is a test -[[message]]-
and I want to match -[[message]]-
This is my trying \w $
How can I do that?
CodePudding user response:
You can use \S
, a negative character class matching any character that is not a whitespace character (such as space, tab, new line, etc.):
\S