Pattern matching
I want to shorten mob names from say "Sun Weaver Archer" to "S. W. Archer". I use
Code:
string.gsub(name, "%s?(.[\128-\191]*)%S+%s", "%1. ") Code:
string.gsub(name, "%s?(%S)%S+%s", "%1. ") The other problem I have is when I run this for name = "Echo of a Pandaren Monk", it would return "E. o. aP. Monk" (no space between a and P.). How would I fix this. Would appreciate some explanations about this. |
See here:
http://www.wowinterface.com/forums/s...ad.php?t=46497 Since that thread is about the same thing, any replies should be posted there, so the discussion stays in one place. |
Thanks for the pointer, Phanx. I only searched for "pattern matching" and the like and so I haven't found the other threat. I'll post there then.
|
All times are GMT -6. The time now is 11:33 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI