Register forum user name Search FAQ

Gammon Forum

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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Matching "[ ] ;

Matching "[ ] ;

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


Posted by TruckDriver22   Denmark  (22 posts)  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!
Top

Posted by David Haley   USA  (3,881 posts)  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
Top

Posted by TruckDriver22   Denmark  (22 posts)  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!
Top

Posted by David Haley   USA  (3,881 posts)  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
Top

Posted by Nick Gammon   Australia  (23,158 posts)  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
Top

Posted by TruckDriver22   Denmark  (22 posts)  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!
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.


20,182 views.

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

Go to topic:           Search the forum


[Go to top] top

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