[Tutor] regex: not start with FOO
Jervis Whitley
jervisau at gmail.com
Tue Feb 3 02:19:30 CET 2009
On Tue, Feb 3, 2009 at 9:46 AM, Bernard Rankin <berankin99 at yahoo.com> wrote:
> Hello,
>
>
> I'd like to match any line that does not start with FOO. (Using just a reg-ex rule)
>
> 1) What is the effective difference between:
>
> (?!^FOO).*
>
> ^(?!FOO).*
>
> 2) Is there a better way to do this?
>
myline = 'FOO things in line'
>>> myline.startswith('FOO')
True
Cheers,
More information about the Tutor
mailing list