Permalink
Browse files

Add explanation about matching stings

  • Loading branch information...
1 parent 76f2a70 commit eea34f83bbe8580d2284d1faa7c466f352509a74 @Floby committed Jan 16, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 examples/simple.js
View
@@ -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");

0 comments on commit eea34f8

Please sign in to comment.