[Tutor] regex question

Richard D. Moores rdmoores at gmail.com
Tue Jan 4 16:37:01 CET 2011


I use

regex = ".*" + search + ".*"
p = re.compile(regex, re.I)

in finding lines in a text file that contain search, a string entered
at a prompt.

What regex do I use to find lines in a text file that contain search,
where search is a word entered at a prompt?

Thanks,

Dick Moores


More information about the Tutor mailing list