En Tue, 21 Jul 2009 02:02:57 -0300, Astan Chee
escribió:
I'm reading text from a file (per line) and I want to do a regex using
these lines but I want the regex to ignore any special characters and
treat them like normal strings.
Is there a regex function that can do this?
Here is what I
I think the re.escape did the trick.
to answer your questions:
By "ignore" i meant instead of using non-alphanumeric characters that
have special significance in regular expression (e.g. [|\]) and treat
them as normal strings (i.e preceded by \), but since I don't know all
the characters in reg
On Jul 21, 3:02 pm, Astan Chee wrote:
> Hi,
> I'm reading text from a file (per line) and I want to do a regex using
> these lines but I want the regex to ignore any special characters and
> treat them like normal strings.
> Is there a regex function that can do this?
It would help if you were to
Astan Chee wrote:
> I'm reading text from a file (per line) and I want to do a regex using
> these lines but I want the regex to ignore any special characters and
> treat them like normal strings.
> Is there a regex function that can do this?
Maybe re.escape helps?
--
Frank Buss, f...@frank-b
Hi,
I'm reading text from a file (per line) and I want to do a regex using
these lines but I want the regex to ignore any special characters and
treat them like normal strings.
Is there a regex function that can do this?
Here is what I have so far:
fp = open('file.txt','r')
notes = fp.readlines