On Thu, Sep 24, 2009 at 3:51 PM, Steven Roussey <[email protected]> wrote:
>
> default to whatever the user passed:
>
> function _MakeTokenRegex(meta_left, meta_right) {
> // TODO: check errors
> return new RegExp('(' +
> (META_ESCAPE[meta_left]||meta_left) +
> '.+?' +
> (META_ESCAPE[meta_right]||meta_right) +
> '\n?)', 'g'); // global for use with .exec()
> }
Yes, the intention is to allow <% %> if you want. But I don't think
it should be too hard to do in a principled way -- escape [ ] {} and
other metacharacters if they appear anywhere. That is, {% %} should
also work, but it doesn't with your fix.
I guess a general regex escape is not really necessary, [] {} () are
the real ones we want to take care of.
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON
Template" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---