Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ Regular expression ... matching '*' character
Regular expression ... matching '*' character
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Sdj79
Belgium (4 posts) Bio
|
Date
| Wed 14 Jul 2004 11:54 AM (UTC) |
Message
| I was wondering how to match the * char
I'm trying to convert this
[*@@#######XXXXXXXXxxxx.........]
to numerical value ... my preblem is that i can't have * matched
A this time i've:
^[ ]*\[([\x2a]*)([\@]*)([\#]*)([X]*)([x]*)([\.]*)]$
which works perfectly but for the *
Can anyone help me? | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #1 on Wed 14 Jul 2004 02:10 PM (UTC) |
Message
| Try escaping it with \*. |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Sdj79
Belgium (4 posts) Bio
|
Date
| Reply #2 on Wed 14 Jul 2004 05:06 PM (UTC) |
Message
| That's the first thing i tried ... as it worked for other chars like '.'
But unfortunately that doens't seem to work with *
:s | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #3 on Wed 14 Jul 2004 05:48 PM (UTC) |
Message
| It DOES work with * though. Perhaps other parts of your expression are problematic?
Try a regexp with JUST \* (match on a single asterisk) then check keep evaluating, repeat on same line, regexp, and change the color of it. Just to see if it is indeed some problem with... well, I dont know, that prevents you from matching. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #4 on Wed 14 Jul 2004 06:08 PM (UTC) |
Message
| A this time i've:
^[ ]*\[([\x2a]*)([\@]*)([\#]*)([X]*)([x]*)([\.]*)]$
The * looks to be after the open [ but you have it before.
\[\*
The final ] does not appear to be escaped.
\]
^[ ]\[\*([\x2a]*)([\@]*)([\#]*)([X]*)([x]*)([\.]*)\]$
Maybe that one will work. |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Sdj79
Belgium (4 posts) Bio
|
Date
| Reply #5 on Wed 14 Jul 2004 06:08 PM (UTC) |
Message
| you were right it's the @ matching that doesn't work :s
Trying to figure out why | Top |
|
Posted by
| Sdj79
Belgium (4 posts) Bio
|
Date
| Reply #6 on Wed 14 Jul 2004 06:12 PM (UTC) |
Message
| And found the solution ...
@ had to be matched using \x40
Thx for your help | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #7 on Wed 14 Jul 2004 08:45 PM (UTC) |
Message
| You dont need to escape the @, thats probably why its not matching. Actually no, thats not it. Do you have "expand variables" checked? (If so, why?) There shouldnt be anything wrong with matching on @ (unless you do have expand variables checked). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | 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.
22,799 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top