[Tutor] redemo.py and r'python\.org'

Dick Moores rdm at rcblue.com
Thu Oct 13 23:25:01 CEST 2005


Alan Gauld wrote at 14:09 10/13/2005:
>Hi Dick,
>
> > I've begun to try out redemo.py to test and learn regular 
> expressions. It
> > doesn't seem to accept Python's raw strings as raw strings, e.g.,
> > r'python\.org'  for matching  python.org  and nothing else. Am I 
> correct,
> > or is there something I don't understand here?
>
>I might be getting confused but are you trying to use the raw string
>as your regex? I don't think you can do that, the re module will consider
>the regex as a raw string.
>
>In other words if you want to match pyhon.org just use 'python\.org'
>with no 'r' in front.
>
>Does that help or have I misunderstood the problem?

You understood my confusion. Thank you!

Dick



More information about the Tutor mailing list