Only a lunatic would attack tide-tables with a regex. :-) --j On Nov 10, 2011 1:24 PM, "Alex Satrapa" <[email protected]> wrote:
> On 11/11/2011, at 04:10 , John Gold wrote: > > > Question -- Now that you've laid it out, I understand what the > > expression does, except for the \1 at the end of the search pattern. > > What does that do? > > You're asking about deepest darkest tech magic. I could tell you, but then > I'd have to shoot you :) > > But seriously … > > The short answer is that "^(\d+)(.*)\r\1" contains two matching sets: > (\d+) and (.*). In regexes you can refer to matched sets using \1 through > \9. So after the regex has matched everything but the \1, the engine now > has two value it's looking for. In this case \1 is the number before the > tab (matched using \d+ meaning "one or more digits"). > > The long answer is: pick up "Mastering Regular Expressions" from O'Reilly > Press. It's a must-have reference. Find it here: > > http://shop.oreilly.com/product/9780596528126.do?green=20956246-2551-5FD2-AF0B-2D7849E2B360&cmp=af-mybuy-9780596528126.IP > > Regards > Alex > > PS: strictly speaking, I wouldn't need to shoot you since you'll either > end up being a deepest darkest tech wizard yourself, or your head will > spontaneously explode from trying to grok regexes. -- 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. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
