in reply to multiple options for pattern match help

Try this,
my $regexp = qr/ (?: ( int | char | bool | long ) ) /x; if ($string =~ /\A $regexp \z/xms){ print $&, "\n"; }

PooLpi
Update : Parenthesis, thanks lima1 ;)

Replies are listed 'Best First'.
Re^2: multiple options for pattern match help
by alexm (Chaplain) on Jan 08, 2008 at 23:20 UTC
    my $regexp = qr/ (?: ( int | char | bool | long ) ) /x;
    There's still the grouping parentheses. It should be like this in order to follow lima1's update:
    my $regexp = qr/ (?: int | char | bool | long ) /x;