Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add explanation about matching stings

  • Loading branch information...
commit eea34f83bbe8580d2284d1faa7c466f352509a74 1 parent 76f2a70
@Floby authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 examples/simple.js
View
5 examples/simple.js
@@ -6,7 +6,10 @@ var t = new Tokenizer(function(token, match) {
});
t.addRule(/^"[^"]*"$/, 'citation');
-t.addRule(/^"[^"]*$/, 'maybe citation')
+t.addRule(/^"[^"]*$/, 'maybe citation');
+// the 'maybe citation' rule is here to continue matching until
+// the closing quote is found
+
t.addRule(/^salut$/i, 'salut');
t.addRule(/^[',;.:!?-]$/, 'ponctuation');
t.addRule(/^\w+$/, "word");
Please sign in to comment.
Something went wrong with that request. Please try again.