Re: Regex not matching a string

2013-01-09 Thread Peter Otten
python.pro...@gmail.com wrote: > In the following code ,am trying to remove a multi line - comment that > contains "This is a test comment" for some reason the regex is not > matching.. can anyone provide inputs on why it is so? > def find_and_remove(haystack, needle): > pattern = re.compile(

Re: Regex not matching a string

2013-01-09 Thread Steven D'Aprano
On Wed, 09 Jan 2013 02:08:23 -0800, python.prog29 wrote: > Hi All - > > > In the following code ,am trying to remove a multi line - comment that > contains "This is a test comment" for some reason the regex is not > matching.. can anyone provide inputs on why it is so? It works for me. Some ob

Regex not matching a string

2013-01-09 Thread python . prog29
Hi All - In the following code ,am trying to remove a multi line - comment that contains "This is a test comment" for some reason the regex is not matching.. can anyone provide inputs on why it is so? import os import sys import re import fnmatch def find_and_remove(haystack, needle): pat