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
buffy_m_50
Newbie


Joined: 10 Aug 2005
Posts: 8

PostPosted: Fri Apr 04, 2008 6:55 pm   

help with word list from a string
 
I have a trigger that store a mob short description in a variable: @mobshort
i need an alias that takes the variable @mobshort and delete some unuseful words and store the useful in a list : @mobtarget
example:
#var mobshort {The wolf of Arcadia}
i need #var mobtarget {wolf|arcadia} so then i try to kill wolf and if i dont hit him i try arcadia.

unuseful words= el, ella, un, una, de

thx for help
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Fri Apr 04, 2008 7:02 pm   
 
Code:
#var mobtarget %subregex(%trim(%subregex(@mobshort,"\b(el|ella|un|una|de)\b")),"\s+","|")



This one splits the string into words excluding el ella un una de
Code:
#var mobtarget %subregex(%subregex(@mobshort,"([^\w]+|(?:\b(el|ella|un|una|de)\b))+","|"),"(^\|+)|(\|+$)")
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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