Regexes: How to handle escaped characters

John Machin sjmachin at lexicon.net
Thu May 17 20:18:29 EDT 2007


On May 18, 9:46 am, Paul McGuire <p... at austin.rr.com> wrote:
> On May 17, 6:12 pm, John Machin <sjmac... at lexicon.net> wrote:
>
> > Note: "must not be *part of* any match" [my emphasis]
>
>
> > While we're waiting for clarification from the OP, there's a chicken-
> > and-egg thought that's been nagging me: if the OP knows so much about
> > the searched string that he can specify offsets which search patterns
> > should not span, why does he still need to search it?
>
> I suspect that this is column/tabular data (a log file perhaps?), and
> some columns are not interesting, but produce many false hits for the
> search pattern.
>

If so, why not split the record into fields and look only at the
interesting fields? Smells to me of yet another case of re abuse/
misuse ...





More information about the Python-list mailing list