Highlighting an entire line containing matched regexp

Posted by Boxknife on Sun 23 Nov 2008 11:38 PM — 6 posts, 22,407 views.

#0
I want to write a trigger that highlights everything between quotation marks. Right now I have a trigger set to fire on "*", but it only highlights the quotation marks themselves. I want the trigger to highlight everything in between, too.

How do I do that?
Australia Forum Administrator #1
Can you show us the trigger please:

http://mushclient.com/copying
#2
<triggers>
<trigger
custom_colour="2"
enabled="y"
group="Highlighted Words"
ignore_case="y"
keep_evaluating="y"
match="\&quot;*\&quot;"
regexp="y"
repeat="y"
sequence="90"
other_text_colour="silver"
>
</trigger>
</triggers>

Australia Forum Administrator #3
Change it to:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   group="Highlighted Words"
   ignore_case="y"
   keep_evaluating="y"
   match="\&quot;.*\&quot;"
   regexp="y"
   repeat="y"
   sequence="90"
   other_text_colour="silver"
  >
  </trigger>
</triggers>


You need a dot before the *, because .* means "any number of anything".
Australia Forum Administrator #4
You might also want to change from:


".*"


to:


".*?"


The question mark makes the match "less greedy" which will make a difference if you have two lots of quoted things in a single line.
#5
This works! Thanks.