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
Gimli
Beginner


Joined: 16 Oct 2005
Posts: 22
Location: Canada

PostPosted: Sun Jun 03, 2012 4:37 pm   

Proper way to match this...
 
What is the proper way to match this?

Code:

Hits : 130 (138)

or

Hits : 12 ( 12)


I've tired

Hits ~: (%s%d) ~((%s%d)~)

But it doesn't seem to work (though I thought it did before.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Jun 03, 2012 8:24 pm   
 
It appears %s will not match nothing. I was also positive it did, I use it in many places under the assumption that it'll match spaces if they're there, or nothing if they're not. Did this change recently?

This pattern works, anyway:
Code:
Hits ~: ({%s|}%d) ~(({%s|}%d)~)

You need to account for the possibility of there not being spaces there now, apparently.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jun 04, 2012 2:48 am   
 
As far as I know, it didn't change recently. Also, [%s%d] with a %trim() would probably work better here.
_________________
EDIT: I didn't like my old signature
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