re problem

Brian Quinlan brian at sweetapp.com
Fri Jan 25 15:32:45 EST 2002


Joshua wrote:
> > self.linear = re.compile("y = [\d+?]x [+|-] \d+", re.IGNORECASE)
> 
> Just a guess, but don't you either need to double your backslashes or
make
> the string a raw string?

In this case, no. \d is not a valid Python escape, so it is treated
literally. As a matter of style, the string probably should be raw.

Cheers,
Brian





More information about the Python-list mailing list