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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Reddytedy
Apprentice


Joined: 13 Oct 2000
Posts: 114
Location: USA

PostPosted: Wed Jan 29, 2003 8:04 pm   

Can you use wildcards in the %replace?
 
I have an odd string that I have just about completely gotten to display the way I want. However there is one thing I need to replace with a blank space and it is making me go mad with frustration.

I need to replace a string of numbers that can change at the drop of a hat. Sometimes it will be 11002341 othertimes it could be 22019302 or something else completely different.

Is there a way to use a wildcard or predefined variable to replace it with a null space?

Alan

Come play with us in Dragonrealms

http://www.play.net/dr
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Wed Jan 29, 2003 8:57 pm   
 
%d in the trigger pattern can pick up any number. But I'm not certain exactly what you are trying to do. Perhaps if you gave us a few lines from the mud along with exactly why you want to remove this.

For example, if you just want to remove any number, you can search for 0-9 and replace them with a space, then remove any multiple spaces.

A #sub or #psub may also word for what you need.

If you can trigger off the line and ID the number using %d, then use can use #PSUB to replace this entire number with a single space.



Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.50
Zmapper Version 1.14
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 29, 2003 9:22 pm   
 
quote:

For example, if you just want to remove any number, you can search for 0-9 and replace them with a space, then remove any multiple spaces.



Or better yet, just replace the digits with an empty string.

You can also do some more complex stuff:
#IF (myVar =~ "(*)%d(*)") {#VAR myVar {%concat("%%1", "%%2")}}

I can't remember/test right now if the % has to be doubled, but you should be able to find that out quickly.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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