On Mon, Dec 23, 2013 at 6:44 AM, Stephan Hradek <[email protected]>wrote:

>  I think the problem of the original, which looked completely okay, might
> be some kind of stack overflow.
>

Yes, I found a couple of references suggesting that:

http://stackoverflow.com/questions/17720683/firefox-length-limit-in-regular-expression-is-it-a-bug



> I already had problems with regular expression implementations when using
> alternatives with "*" as quantifier. If your intention really is to have \s
> and \S in the pre, I thing this would do:
>
> ([\s\S]*)
>
> without looking into the code I'd like to not that this isn't a good way
> for "parsing" xml/html.
>
> Your div regexp;
>
> /^\s*<div\s+([^>]*)>((?:\s|\S)*)<\/div>\s*$/gi
>
> would, for example, also match:
>
> <div attr=1>
> <pre>
> tiddler 1
> </pre>
> </div>
> <div attr=2>
> <pre>
> tiddler 2
> </pre>
> </div>
>
> And by "match" I mean that it'll match the whole stuff, not only the first
> div. Ignore this comment if your code already took care of it and you only
> match parts to pick out stuff.
>


This regex is matching against a DIV that has already been sliced out of
the file, so it doesn't get a chance to match greedily across into the
adjacent DIV.

I'm in the process of completely refactoring the code; it dates from the
beginning of TW5.

Best wishes

Jeremy



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to