|
Cassandra Newbie
Joined: 12 Jan 2004 Posts: 6 Location: USA
|
Posted: Thu May 19, 2005 4:25 pm
Multiple #CW in one line |
Mud shows something like this:
Myrna looks over the young girl, her nose wrinkling up. "I'm sorry, child, but I do not have time for such things." The woman gathers her skirt up in her hands, making to trudge off again. "Seek out the Tower if you wish assistance." With that she parts from her company, heading off to the west.
I want to see this:
Myrna looks over the young girl, her nose wrinkling up. "I'm sorry, child, but I do not have time for such things." The woman gathers her skirt up in her hands, making to trudge off again. "Seek out the Tower if you wish assistance." With that she parts from her company, heading off to the west. (or a close variation on this)
Basically, I want it to pick up things that are between quotes and color it so that I can distinguish it from other text.
I started with "%w*" and "%a*" (hoping that it would distinguish a "Test." from " Test. ", since the latter, with the extra spaces around the word test, is the way a non-speaking portion looks like). Both end up highlighting -everything- between the first quote and the last (ie. Myrna "tests," tests, "and tests again.")
I've been working at this for the last few days, and still can't come up with the correct way to do it. Everything I've tried either highlights everthing between first and last quote (as in the example above), or only highlights the first set of text, while leaving any subsequent ones in black...any suggestions? Is this even possible? Thanks so much. |
|
_________________ Cassandra |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu May 19, 2005 10:21 pm |
ZMud looks for the largest matching pattern. That's why you're having the trouble you are. Your best bet is to include some literal text to each trigger.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu May 19, 2005 10:42 pm |
In order to this your have to use an advanced #REGEX trigger. zMud internally converts all triggers to regexes, but the process produces a simplistic pattern. Becuase of this simple pattern the internal quotes in your example are being eaten in the * portion of the pattern. The correct trigger to use is:
#REGEX {\"(.*?)\".*?(?:\"(.*?)\".*?(?:"(.*?)\".*?(?:\"(.*?)\".*?(?:\"(.*?)\"))))} {#PCOL red %x1;#PCOL red %x2;#PCOL red %x3;#PCOL red %x4;#PCOL red %x5}
This supports 1 to 5 matches, but will not match when there are mismatched quotes within the expected 5 sets. You can extend it by simply adding more embedded sections of '.*?(?:\"(.*?)\")' to the end of the exitisting pattern and additional #PCOL's |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|