Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

search example

  • Loading branch information...
commit 45dd0871160e8c63509ebbc7d753f7eb93fc0cf6 1 parent 4acc89f
@substack authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 example/search.js
View
14 example/search.js
@@ -0,0 +1,14 @@
+var quotemeta = require('../');
+
+var query = new RegExp('\\d ' + quotemeta('node.js'));
+var filter = function (x) { return query.test(x) };
+
+var xs = [
+ '0 node^js y',
+ '1 node_js x',
+ '2 node.js 5',
+ '3 beep z',
+ 'X node.js Y',
+ '4 boop w'
+];
+console.dir(xs.filter(filter));
Please sign in to comment.
Something went wrong with that request. Please try again.