$str="onetwo"; And my match is: m/(.*)<\/a>/s My result for $1 is: onetwo How would I get it so it returns just "one"