Home > Enterprise >  How to match a word that contains symbols?
How to match a word that contains symbols?

Time:11-22

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 
  • Related