03-27-2013, 07:43 AM
Isn't it just That can get numbers as well as letters.
Or if you really want to grab numbers or strings with single quotes around them, you could do.
(I used http://rubular.com/ to test this out. Very helpful.)
I use a lot of regular expressions in my current project to do all sorts of cool things. Such as a Message Window that word wraps, automatic capitalization in case I forget, and also use it to vary messages the player has to read often so they don't get bored.
Code:
/\[#{CUSTOM_FLAG}(?:ECT)?[ ]*(\w+)\]/
Or if you really want to grab numbers or strings with single quotes around them, you could do.
Code:
/\[#{CUSTOM_FLAG}(?:ECT)?[ ]*'?(\w+)'?]/
(I used http://rubular.com/ to test this out. Very helpful.)
I use a lot of regular expressions in my current project to do all sorts of cool things. Such as a Message Window that word wraps, automatic capitalization in case I forget, and also use it to vary messages the player has to read often so they don't get bored.