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
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Wed Sep 07, 2011 12:12 am   

Match 0 or more spaces?
 
Hey... hopefully just a quick question... got a pattern I want to match which is a digit, but it's padded, so it could look like:

Code:

1  (rnd)
12 (14 )
123(151)


So I figured:

(%d)%s~((%x)%s~)

But %s matches one or more spaces... I need to match zero or more.

Is there such a thing without using regex?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4252
Location: Pensacola, FL, USA

PostPosted: Wed Sep 07, 2011 12:37 am   
 
yes:
{%s|}
_________________
Discord: Shalimar#3679
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Sep 07, 2011 3:55 am   
 
a range might be better here. [%s%d]
_________________
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