Re: [Tutor] Matching with beginning of the line in the character set

2005-02-01 Thread Mike Bell
I was using raw strings although I forgot to put that in. > > -Original Message- > From: Kent Johnson [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 01, 2005 1:15 PM > Cc: Tutor@python.org > Subject: Re: [Tutor] Matching with beginning of the line in the > character

Re: [Tutor] Matching with beginning of the line in the character set

2005-02-01 Thread Kent Johnson
Sent: Tuesday, February 01, 2005 1:15 PM Cc: Tutor@python.org Subject: Re: [Tutor] Matching with beginning of the line in the character set Smith, Jeff wrote: I want to match a string which is preceeded by a space or occurs at the beginning of the line. I also don't want to catch the precee

RE: [Tutor] Matching with beginning of the line in the character set

2005-02-01 Thread Smith, Jeff
Kent Johnson [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 01, 2005 1:15 PM Cc: Tutor@python.org Subject: Re: [Tutor] Matching with beginning of the line in the character set Smith, Jeff wrote: > I want to match a string which is preceeded by a space or occurs at > the beginning of the li

Re: [Tutor] Matching with beginning of the line in the character set

2005-02-01 Thread Kent Johnson
Smith, Jeff wrote: I want to match a string which is preceeded by a space or occurs at the beginning of the line. I also don't want to catch the preceeding character as a group. I have found both of the following to work re.compile('(?:^|\s)string') re.compile('(?:\A|\s)string') H

[Tutor] Matching with beginning of the line in the character set

2005-02-01 Thread Smith, Jeff
I want to match a string which is preceeded by a space or occurs at the beginning of the line. I also don't want to catch the preceeding character as a group. I have found both of the following to work re.compile('(?:^|\s)string') re.compile('(?:\A|\s)string') But would prefer to