|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Tue Jan 09, 2007 2:49 pm
SubRegex Workarounds Anyone? |
Heres the working function from zmud with %1 and %2 replaced with $input and $color respectively
Code: |
%subregex( $input, "((?:[^a-zA-Z0-9]|^)+)([a-zA-Z0-9/-/:])([a-zA-Z0-9]*)", %char( 37)1~@%upper( $color)%char( 37)2~@%lower( $color)%char( 37)3%char( 37)4) |
Unfortunately, I can't get this to work at all, and would REALLY like it to, so any help would be appreciated
Its meant to turn
Quote: |
@highlight(Some Text,R) |
into
I used to do it with a recursive function, but that was worse, it crashed cmud
Thanks |
|
_________________ The Drake Forestseer |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Tue Jan 09, 2007 3:15 pm |
The variables in the last argument should be %1..%99, if you want the matches from the regex pattern. Also, you should have it in quotes (as per the documentation) to prevent early evaluation of the expression. I found that %subregex doesn't seem to save the values into %1..%99 as it should, however, so you may not get it working even with the correct syntax. Just a heads up.
|
|
|
|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Tue Jan 09, 2007 11:48 pm |
Yeah, thats what i meant, this was the final syntax that i used to make it work in zMud, after trying and realising that the %1-%99 vars arent being saved for the subregex, so does anyone perhaps have another way of doing this in a function syntax?
|
|
_________________ The Drake Forestseer |
|
|
|
|
|
|
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
|
|