I’m trying I have a string that I pass into my function from user input and I use regex to detect if there is a non-word character present in it (symbol) I want to then extract the frist character of the string in array[0] and rest in array[1] is there any way I can do this in regex, perhaps /^(zero length selector)/, I’ve tried writing my own expression but sofar having trouble getting it to work. Any Ideas?
EDIT:
I’m basically looking for a regexp that can select space between index 0 and 1 so i can split on that. So if say ‘#domElementId’ goes in [‘#’,’domElementId’] comes out.
Actually figured it out, ended up really easy after 2 days of learning the in’s and outs of RegExp. StackOverflow has been an indispensable help though. Anyway here is what I finally came up with.