in reply to Reg Ex Problem: Changing width dimension in HTML table
The quotation mark (if any) is captured in $2 and backreferenced by \2 in the RegEx. The curly braces {0,1} take care that the quotation mark doesn't match too often$rep_contact_info = '<table width ="12">'; $rep_contact_info =~ s/(<\s*table.*?width\s*=\s*("{0,1})).*?(\2.*?>)/$ +{1}300${3}/si; print $rep_contact_info;
|
|---|