On Sun, Mar 21, 2010 at 06:40:39PM -0700, Warren Michelsen wrote:
> At 7:30 PM -0400 3/21/10, Ronald J Kimball sent email regarding Re: 
> >Oops, I forgot the (?s)...
> >
> >(?s)(<tr[^>]*>\s*(?:<td[^>]*>(?:(?!</td>).)*</td>\s*){2})<td[^>]*>(?:(?!</td>).)*</td>
> >
> >Ronald
> 
> Alas, in a table with over 100 rows, BBEdit runs out of stack space:
> "out of stack space (application error code: 12246)"
> This happens with a Replace All and with repeated Replace and Find 
> (one at a time).

Unfortunately, that can happen in BBEdit with a sequence like (?:.)*
matching against a long block of text.  What version of BBEdit are you
running, by the way?

I'm afraid I don't have a recent version of BBEdit at hand to test with...
One of these might work better:

(?s)(<tr[^>]*>\s*(?:<td[^>]*>(?>(?:(?!</td>).)*)</td>\s*){2})<td[^>]*>(?>(?:(?!</td>).)*)</td>

(<tr[^>]*>\s*(?:<td[^>]*>(?:<(?!/td>)|[^<]+)*</td>\s*){2})<td[^>]*>(?:<(?!/td>)|[^<]+)*</td>

(<tr[^>]*>\s*(?:<td[^>]*>(?>(?:<(?!/td>)|[^<]+)*)</td>\s*){2})<td[^>]*>(?>(?:<(?!/td>)|[^<]+)*)</td>

(?>...) means once the subpattern has matched, don't backtrack into it to
try to match it differently.

Let us know how those work out for you.


Alternatively, the original regex does work in Perl.  :)

Ronald

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
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/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.

To unsubscribe from this group, send email to 
bbedit+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to