[Tutor] How Match a Dot?
kent37 at tds.net
Wed Sep 24 04:12:15 CEST 2008
On Tue, Sep 23, 2008 at 10:02 PM, Wayne Watson
<sierra_mtnview at sbcglobal.net> wrote:
> How do I match a dot in, for example, abc.txt? I want to match it exactly.
> There must be some sort of escape.
Assuming you want to match in a regular expression, use \ as an escape
and use raw strings.
In : import re
In : m=re.search(r'\.', 'abc.de')
In : m.start()
More information about the Tutor