in reply to Regex Pipe Return
you want this:
$string =~ m/(A|B)(A|B)/; $match="$1$2"; [download]
or this:
$string =~ s/(A|B)(A|B)/lc("$1$2")/e; [download]
or do you need $PREMATCH, $MATCH and $POSTMATCH ?
Cheers Rolf