Regexp of strings

Posted by Urte on Fri 19 Jul 2002 11:40 AM — 4 posts, 15,996 views.

#0
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
Amended on Fri 19 Jul 2002 11:41 AM by Urte
Canada #1
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>
#2
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
Australia Forum Administrator #3
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>