On Tue, Feb 3, 2009 at 11:12 AM, Bernard Rankin wrote:
> In [3]: re.findall('^(?!FOO)in', 'in in in')
> Out[3]: ['in']
>
> In [4]: re.findall('(?!^FOO)in', 'in in in')
> Out[4]: ['in', 'in', 'in']
>
> In [5]: re.findall('(?!FOO)in', 'in in in')
> Out[5]: ['in', 'in', 'in']
>
> In [6]: re.findall(
> > 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).*
>
> One difference is that the first will match starting anywhere in a
> string, while the second will matc
> > 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).*
>
> One difference is that the first will match starting anywhere in a
> string, while the second will matc
On Mon, Feb 2, 2009 at 5:46 PM, Bernard Rankin 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).*
One difference is that the first will match starting anywhere
> > 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.startswi
On Tue, Feb 3, 2009 at 9:46 AM, Bernard Rankin 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 thin
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?
Thanks,
:)
___
Tutor maillist - Tutor