Highlighting two separate expressions on one line

Posted by Kinjiru on Tue 11 Jul 2023 05:27 AM — 3 posts, 8,698 views.

#0
So, say you have something like this:

Telepathy[Bob] Hello!

You want the Telepathy[Bob] part to be a certain color.

You want everything after Telepathy[Bob] to be a different color.

And, Bob isn't the only player so you're matching any player there.

I accomplished the first part with ^(Telepathy\[.*\]) but I am unsure how I can highlight the rest of the message (which can be any text) a different color.
Amended on Tue 11 Jul 2023 05:28 AM by Kinjiru
Australia Forum Administrator #1
Make two triggers, like this:


<triggers>
  <trigger
   custom_colour="3"
   enabled="y"
   keep_evaluating="y"
   match="^(Telepathy[.*]).*$"
   regexp="y"
   sequence="50"
  >
  </trigger>
  <trigger
   custom_colour="2"
   enabled="y"
   match="^(Telepathy[.*])"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>


The first trigger (with the lower sequence number, and "keep evaluating" checked) colours the whole line.

The second trigger colours the Telepathy[someone] part, so that change the colours back.

Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
#2
Worked like a charm! Thanks so much, Nick.