<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think the re.escape did the trick.<br>
to answer your questions:<br>
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 regular expression that have special significance, I
don't know which ones to add a '\' infront of.<br>
Thanks anyway<br>
<br>
John Machin wrote:
<blockquote
cite="mid:ce9a527a-767f-481a-9a48-00492ae7a88f@g1g2000pra.googlegroups.com"
type="cite">
<pre wrap="">On Jul 21, 3:02 pm, Astan Chee <a class="moz-txt-link-rfc2396E" href="mailto:astan.c...@al.com.au"><astan.c...@al.com.au></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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?
</pre>
</blockquote>
<pre wrap=""><!---->
It would help if you were to say
(1) what "ignore ... characters" means -- pretend they don't exist?
(2) what are "special chararacters" -- non-alphanumeric?
(3) what "treat them like normal strings" means
(4) how you expect these special characters to be (a) ignored and (b)
"treated like normal strings" /at the same time/.
Cheers,
John
</pre>
</blockquote>
</body>
</html>