[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]  Matching "[ ] ;
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Matching "[ ] ;

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


Posted by TruckDriver22   Denmark  (22 posts)  [Biography] bio
Date Fri 20 Feb 2009 06:26 AM (UTC)

Amended on Fri 20 Feb 2009 06:31 AM (UTC) by TruckDriver22

Message
This is my promt

222H 22V 2222X 2C [Truckdriver:v.good] [Nick Gammon:Good] Exits:E(W)>

No matter how i try i cant get nothing to match the [ ] :

and this is what it looks like if your assisting someone

222H 22V 2222X 2C [Truckdriver:v.good] [Thetank:Awful] [Nick Gammon:Good] Exits:E(W)>

Some times it needs to match ' - , in there to.! like

[Truck'son the half-elf] but i just want it to see if i am tanking or assisting. so i am not sure if that will matter.

Click bang... GAME OVER!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Fri 20 Feb 2009 04:26 PM (UTC)
Message
If you are using regular expressions, you need to escape the '[' character because otherwise it counts as a character class. To escape it, use '\['.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by TruckDriver22   Denmark  (22 posts)  [Biography] bio
Date Reply #2 on Fri 20 Feb 2009 07:53 PM (UTC)
Message
Thanks that helped sum but i still need help with matching the words inside the [] i was using (.+) to match the inside parts

[Truck'son the half-elf]

Click bang... GAME OVER!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #3 on Fri 20 Feb 2009 08:35 PM (UTC)
Message
It would be helpful to show your trigger, so that we can see what we're working with. :-)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sat 21 Feb 2009 01:30 AM (UTC)
Message
When you started this thread, amongst other things, the new thread header asked for:


A literal copy of the trigger (there is a Copy button) - see http://www.mushclient.com/copying for exact details.


Asking for help with a trigger, without showing what you have attempted, makes it very hard to know what you are doing.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by TruckDriver22   Denmark  (22 posts)  [Biography] bio
Date Reply #5 on Sat 21 Feb 2009 03:55 AM (UTC)
Message
^(\d+)H (\d+)V (\d+)X (\d+)C \[Me\:(.+)\] \[(.+)\:(.+)\] \[(.+)\:(.+)\] Exits(.+)

t0 match if not tanking does not work

^(\d+)H (\d+)V (\d+)X (\d+)C \[Me\:(.+)\] \[(.+)\:(.+)\] Exits(.+)

this is to match tanking

Click bang... GAME OVER!
[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.


4,320 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]