[jQuery] jQuery.Tokenizer

[jQuery] jQuery.Tokenizer


Hi, I thought I'd share with you, this small script I needed for
something else I'm making.
It's a simple JS class to parse strings into tokens. It only requires
one or more string/regexes to find the tokens, and optionally, a
function to parse them into something else (could be a hash, an array,
or w/e).
Then, by just passing it a string, it will return an array with all
the tokens, and also the strings between them.
The documentation shows how to use it for simple templating, or CVS
parsing. Those are just examples, this can make the base of any
templating/interpreting/parsing engine.
It can be used standalone, or as a jQuery plugin, this is done
automatically. It can be accessed by $.tokenizer if jQuery is (was)
included, or Tokenizer as standalone version.
Don't expect fancy demos, or endless documentation, this is a small
script.
So, if you ever need something like this, consider it as an option.
Homepage:
http://flesler.blogspot.com/2008/03/string-tokenizer-for-javascript.html
Project Page
http://plugins.jquery.com/project/Tokenizer
Bye
--
Ariel Flesler
http://flesler.blogspot.com/