Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Urte
(3 posts) 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 | top |
|
| Posted by |
Magnum
Canada (580 posts) 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. | top |
|
| Posted by |
Urte
(3 posts) 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 | top |
|
| Posted by |
Nick Gammon
Australia (18,772 posts) 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 | 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
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )