http://www.perlmonks.org?node_id=1010441


in reply to Regex Pipe Return

I think that you want to return the matched characters.
use strict; use warnings; my $string = 'XXXXXXXXXXABXXXXXXXXX'; my ($match) = $string =~ m/X{10}([AB]{2})X{9}/; print $match;

OUTPUT:

AB

UPDATE: Added Output

Bill