Re: idiom for iterating
Bill Yerazunis <[email protected]> Thu, 23 Apr 2009 16:22:34 -0400
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
From: Ville Laurikari <[email protected]> > > Ville: what do you think? This looks like a "negative lookahead assertion". In Perl, /foo(?!bar)/ matches 'foo' if it's not followed by 'bar'. For a simple example case like this lookahead assertions seem easy enough to implement. But it's not quite so simple to incorporate them into the non-backtracking matching algorithm used in TRE. Hmmm... another justification to get PCRE as an optional engine for CRM114. The simple cases can be implemented programmatically, outside the regex matching library, without adding any features in the regex matcher. As for the more complex cases (ones where the lookahead expression is a full-blown regex and is just a part inside a complex regex), I'd argue that you should probably not be using a regex in the first place. I've considered lookahead and lookbehind assertions before, back when I was still actively developing TRE. I think that Bryan Ford's stuff on PEGs (Parser Expression Grammars) is right up that alley.... I was considering creating a useful PEG but then I started doing exotic classifiers, and havent had... They are probably doable, but I probably ran out of paper or pencil or brain space or something, and gave up :) I feel that way a lot, too. Brain space is hard to budget. Thanks! And if you get bored... :) - Bill Yerazunis ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects