"you cannot assign a regex defined as a literal to a variable"
I'm not sure if I got this right and could probably a stupid question. But by saying you cannot assign, do you mean that the following is invalid or frowned upon?
Hmm I could be wrong I was trying something like this but it was barfing on the \d I think, as soon as I used new RegExp and escaped the \d with a slash it worked.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"you cannot assign a regex defined as a literal to a variable"
I'm not sure if I got this right and could probably a stupid question. But by saying you cannot assign, do you mean that the following is invalid or frowned upon?
Hmm I could be wrong I was trying something like this but it was barfing on the \d I think, as soon as I used new RegExp and escaped the \d with a slash it worked.