Skip to content

Instantly share code, notes, and snippets.

@pimbrouwers
Created August 10, 2016 20:36
Show Gist options
  • Save pimbrouwers/77ed9f42cea4ad932f2a15abd97b0db3 to your computer and use it in GitHub Desktop.
Save pimbrouwers/77ed9f42cea4ad932f2a15abd97b0db3 to your computer and use it in GitHub Desktop.
var re = /^[a-z ,.'-]{2}+$/i;
var str = ' ';
var m;
if ((m = re.exec(str)) !== null) {
if (m.index === re.lastIndex) {
re.lastIndex++;
}
// View your result using the m-variable.
// eg m[0] etc.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment