Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

search example

  • Loading branch information...
commit 45dd0871160e8c63509ebbc7d753f7eb93fc0cf6 1 parent 4acc89f
James Halliday authored December 27, 2012

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. 14  example/search.js
14  example/search.js
... ...
@@ -0,0 +1,14 @@
  1
+var quotemeta = require('../');
  2
+
  3
+var query = new RegExp('\\d ' + quotemeta('node.js'));
  4
+var filter = function (x) { return query.test(x) };
  5
+
  6
+var xs = [
  7
+    '0 node^js y',
  8
+    '1 node_js x',
  9
+    '2 node.js 5',
  10
+    '3 beep z',
  11
+    'X node.js Y',
  12
+    '4 boop w'
  13
+];
  14
+console.dir(xs.filter(filter));

0 notes on commit 45dd087

Please sign in to comment.
Something went wrong with that request. Please try again.