Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Rastamutti
Beginner


Joined: 27 Jun 2012
Posts: 17

PostPosted: Wed Jun 18, 2014 6:48 pm   

Expression matching
 
I need to find a way to match these patterns but just can't figure it out..

George 25,000 0 25,000
Bob 365 0 -326
Earl 338 -400 62

the , throws out %d so I tried to use the wild card * but that just included the next number as well.
After that, negatives just don't show up at all. Figuring this is easy for most of you folks.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 19, 2014 12:22 am   
 
[,%d-]
_________________
EDIT: I didn't like my old signature
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Thu Jun 19, 2014 2:42 am   
 
You shouldn't need a custom class, %n will match all of those.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 19, 2014 11:41 pm   
 
I've had issues with %n not matching on negative numbers.
_________________
EDIT: I didn't like my old signature
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Jun 20, 2014 12:46 am   
 
Hmm, could be the case, I didn't test it - %f definitely does though, if %n doesn't.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net