var pattern = /(?:)/
From my testing, it seems to match everything. Is this the defined behavior?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This doesn’t directly answer the question, but here’s what the spec has to say about the empty regular expression:
From 15.5.4.14 String.prototype.split (separator, limit)
And from 7.8.5 Regular Expression Literals
So given that it is an accepted value for the separator in
.split(), I would guess that it is the defined behavior as a way to split on every character.