thanks...

BA asdffdsa at bellatlantic.net
Tue May 15 14:00:14 CEST 2001


andrew,
urrite. i made something simple much too complicated.
i will drop a buck in the bucket.
thanks again.

"Andrew Kuchling" <akuchlin at mems-exchange.org> wrote in message
news:3du22odmx1.fsf at mems-exchange.org...
> "BA" <asdffdsa at bellatlantic.net> writes:
>
> > the concept is that i do not care if there is leading white space or
not. i
> > do care that the first non-white space character is NOT a single quote.
i am
> >     pat_oe_ok1=r"^[^']\s*Option Explicit"
> >     pat_oe_ok2=r"^\s*[^']\s*Option Explicit"
>
> Dissect these patterns:
>    ^              # Match at start of string
>    [^']           # Match a single character that isn't "'"
>    \s*            # Match zero or more whitespace characters
>    Option Explicit# Match this literal string.
>
> It's not really clear to me exactly what you're trying to match
> because I didn't understand your explanation.  I don't see why the
> simple pattern "^\s*Option Explicit" wouldn't be a suitable pattern;
> you don't have to match strings like "print Option Explicit", do you?
>
> BTW, see the Regular Expression HOWTO at
> http://py-howto.sourceforge.net/regex/ ; it may explain regex patterns
> in more detail than the book you're using.
>
> --amk





More information about the Python-list mailing list