short word color highlight with wildcard

Posted by Essidus on Wed 23 Jan 2008 06:15 PM — 2 posts, 11,400 views.

#0
I'm trying to set up a trigger that highlights everything that ever shows up between () with darkmagenta, but only the () and the text between them, and not the whole line. I've tried the regular expression \(\*\) but it doesn't work, and \(*\) only highlights the right ). What am I doing wrong, and how can I fix this?
Australia Forum Administrator #1
\(\*\) would only match a bracket, a star and a bracket.

You need .+ to match stuff inside the brackets, and I would put an extra ? to make it non-greedy or it might try to match things between multiple brackets. Also check "repeat on same line". This worked for me:


<triggers>
  <trigger
   custom_colour="6"
   enabled="y"
   match="\(.+?\)"
   regexp="y"
   repeat="y"
   sequence="100"
  >
  </trigger>
</triggers>