Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var regexp = /ste/ig;
var names = ['John Smith', 'Steven Hocking', 'Robert Stevenson', 'Steve Hocking', 'Janet Smith'];
var filtered = names.filter(function(name) {return regexp.test(name);});
console.log(filtered.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment