If you want to combine only lines starting with a stop, use
^stop
If you want to match lines starting with stop, then space
^stop\s
Or, if you want to match lines starting with the word stop, and then a space or any other character without a word that you can use (allowing you regular color)
^stop\W
On the other hand, what follows corresponds to the word at the beginning of the line for most regular expression flavors (in these variants, \ w corresponds to the opposite of \ W)
^\w
If your taste has no \ w shortcut, you can use
^[a-zA-Z0-9]+
Be careful that this second idiom will correspond only to letters and numbers, without a symbol.
Check out the regex flavor guide for what shortcuts are allowed and what exactly they match (and how they relate to Unicode.)
Vinko Vrsalovic Aug 6 '09 at 18:06 2009-08-06 18:06
source share