Oh I see now. Thank you for stepping through that for me Ronald. I didn't think it about that way, as I obviously needed to. I was just visualizing one whole line at a time, regardless. Good coders are not as easy to come by as one might assume. ;-) Thanks! -G
> The current behavior does make sense, actually, when you think about how > BBEdit does the search. > > Pattern: > > (<td.*?>)(.+)(</td>) > > Text: > > <table><tr><td>foo</td><td>bar</td></tr></table> > > First, consider searching forward, starting from the beginning of the line. > The regex engine steps forward one character at a time, until it gets to > the first <td>, which is matched by <td.*?>. The next part of the pattern > is .+, which should match as many characters as possible. The regex engine > starts by matching .+ all the way to the end of the line, then backtracks > one character at a time until it gets to the second </td>, which is matched > by (</td>). > > Then consider searching backward, starting from the end of the line. The > regex engine steps backward one character at a time, until it gets to the > second <td>, which is matched by <td.*?>. Once again, the regex engine > matches .+ all the way to the end of the line, then, as before, backtracks > one character at a time until it gets to the second </td>, which is matched > by (</td>). > > The .+ allows the pattern to match across </td><td> to the last </td> on > the line, so you get a different result if you start at the beginning of > the line versus at the end. > > Ronald --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BBEdit Talk" 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/bbedit?hl=en If you have a specific feature request or would like to report a suspected (or confirmed) problem with the software, please email to "[EMAIL PROTECTED]" rather than posting to the group. -~----------~----~----~----~------~----~------~--~---
