Regex Match Problem

David MacQuigg dmq at
Wed Mar 10 18:04:00 CET 2004

On 10 Mar 2004 07:17:12 -0800, bradwiseathome at (bdwise)

>I have this in my body tag:
>And I want to find a part between the semicolons that ends in focus()
>and remove the entire value between the semicolons.
>My Regular Expression looks like this but it is not matching, can
>anyone help?

You need to escape the metacharacters.  Try
Also, use a raw quote, so you don't have to escape the escapes.

Don't forget to set re.DOTALL if you want the '.*' to capture newlines

There is a nice interactive tool for testing these expressions at

There is a good intro to regular expressions at

-- Dave

More information about the Python-list mailing list