in reply to Regex: Optional/alternative catpures

Minor adjustment:

$line =~ / ^ (.+?) (?: < (two|three) > )? $ /xs;

Another approach:

my $pre= $line; my $post= ''; if( $pre =~ s/ \s* < (two|three) > $ //xs ) { $post= $1; }

- tye