in reply to Removing backtracking from a .*? regexp

Perhaps the simplest way is to take two bites at the cherry.

if( $string =~ m[^a=<([^>]*)>] and $1 =~ m[$target] ) { # Do something }

This is often, though not always, the quickest approach.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!
Wanted!