|
buffy_m_50 Newbie
Joined: 10 Aug 2005 Posts: 8
|
Posted: 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 |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: 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." |
|
|
|
|
|
|
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
|
|