|
Reddytedy Apprentice
Joined: 13 Oct 2000 Posts: 114 Location: USA
|
Posted: 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 |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: 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 |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
|
|