my ($match) = $string =~ /<(ab)>/; ($match) = $string =~ /(ab)/ unless defined $match;