 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Thu Mar 27, 2008 3:14 pm
Ansi Triggers in Cmud |
Well, doing an ansi trigger just got a lot harder in Cmud since I now can no longer hit the convert button to convert all the codes over to a regular expression. I took my best stab at an expression in the native Cmud pattern matching and was looking for a little advice on making it better.
My Pattern:
{%e[37m*|}%e[36m(*)%e[37m*%s(%d)%s({On|Off})%s(%w)%e[0m$
Essentially this is to match on a line that has some coloring (the actual name is code 37) that looks like this:
Mr Name Lastname Othernames 2 On Serpent
In regular expressions, this would be:
^(?:code37\D+)?code36(\D+)code37\D*\s+(\d)\s+(On|Off)\s+(\w+)code0$
I guess I could either figure out what the regex codes would be translated into --- and I'm not sure how to do that. Or I can improve the cmud trigger so that it works better. It kind of works now, but I'm unable to anchor it with ^ without it stopping working. I'm not really sure how to do some of the finer points of regex features in the native cmud trigger language. |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Mar 27, 2008 4:13 pm |
The regex equivalent of %e is \033. Also, just so you know, wildcards like %e don't work in the {pattern|pattern} syntax.
EDIT: I must've misunderstood your question, because as far as I can tell this is no different to the other thread. Can you explain a bit better? |
|
|
|
 |
|
|
|