[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Regexp of strings

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Regexp of strings

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Urte   (3 posts)  [Biography] bio
Date Fri 19 Jul 2002 11:40 AM (UTC)  quote  ]

Amended on Fri 19 Jul 2002 11:41 AM (UTC) by Urte

Message
All right. I need to ask a question, I /have/ to be merely missing something simple in regexps or such.

How do I highlight a string so that string (and only that string) appears highlighted in the paragraph?

IE: Say I wish to highlight the name 'James' so it do the following highlights:

James
(James,
James)

Etc. Basically highlight the string no matter where it appears on the line, but only that substring, in case the bold stuff there isn't easily seen.

And I get the feeling I'm missing something simple. ;)

Urte
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #1 on Fri 19 Jul 2002 07:14 PM (UTC)  quote  ]
Message
One of my early triggers, this works on the word "manhole":

<triggers>
  <trigger
   custom_colour="8"
   enabled="y"
   match="(manhole)"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Urte   (3 posts)  [Biography] bio
Date Reply #2 on Fri 19 Jul 2002 10:53 PM (UTC)  quote  ]
Message
Ah. Much better. That works well. My mind's gone off regexps since starting to use Windows programs instead of Tinyfugue, seem to have forgotten almost everything. Thanks!

Urte
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 01 Aug 2002 12:48 AM (UTC)  quote  ]
Message
In fact, you can do without the brackets, which merely return the contents as wildcard 1, which you aren't using.

In your case, just match on "James" and make it a regexp.

eg.


<triggers>
  <trigger
   custom_colour="3"
   enabled="y"
   match="James"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


1,449 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]