[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Regular expression ... matching '*' character
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Regular expression ... matching '*' character

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Sdj79   Belgium  (4 posts)  [Biography] 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?
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] 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!
[Go to top] top

Posted by Sdj79   Belgium  (4 posts)  [Biography] 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
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] 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.
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] 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.
[Go to top] top

Posted by Sdj79   Belgium  (4 posts)  [Biography] 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
[Go to top] top

Posted by Sdj79   Belgium  (4 posts)  [Biography] 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
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] 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.
[Go to top] 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.


6,206 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]