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
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
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
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
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