Regex Match Problem

Robert Brewer fumanchu at
Wed Mar 10 17:24:33 CET 2004

bdwise wrote:
> something();something();
> document.thisForm.textBox1.focus();something();
> 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?
> ";([^.]*).focus()"

Not sure if this is the final result you wanted, but it should overcome
the major hurdles (like not escaping the parentheses ;)

>>> import re
>>> a =
>>>';([^;]*).focus\(\);', a).groups()

Hope that helps.

Robert Brewer
Amor Ministries
fumanchu at

More information about the Python-list mailing list