Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Highlighting a Single Word

Highlighting a Single Word

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Bcw81   (2 posts)  Bio
Date Thu 28 Mar 2013 06:13 PM (UTC)
Message
So, I'm trying to get a single word highlighted. Now, normally I would have no problem with this, but I wanted to get fancy. Specifically, I wanted color words (such as grey) to show up in their color.

Currently I have tried a few things.
"\bgrey.+\b(?i)" doesn't work as it highlights the rest of the line after "grey".

"\bred.(?i)" semi works as it will highlight "red" and "reds", but not things such as "reddish".

"\bred(?i)" is what I've resorted to for the time being, as it at least highlights the color, if not any plural forms or extra suffixes.

Is there any way to highlight one single word and account for a suffix of any length, and then cut the trigger off at the next space? (Ideally, also cut it off in the event of a dash or colon or what have you.)
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 29 Mar 2013 01:10 AM (UTC)
Message
How about this?


<triggers>
  <trigger
   custom_colour="7"
   enabled="y"
   match="\bred\w*"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>


\w* means zero or more "word" characters (eg. reddish)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Bcw81   (2 posts)  Bio
Date Reply #2 on Fri 29 Mar 2013 02:20 AM (UTC)
Message
Ah! Thank you, that worked perfectly!
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,239 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.