Possible Duplicate:
JavaScript RegExp Three Parts
I need a help with regular expressions in JavaScript (Sorry, I’m still trying to learn it.).
I have this strings:
all (any) -del
all -del (any)
all (any)
all -del
all
PS: all, any and del can assume any value, including spaces.
And I need to separate each string:
var1 = all
var2 = any (or null)
var3 = del (or null)
Can you help me with this? Thanks!
How about:
application to your examples:
To process new requirement, a little bit complex: