Help for this page

Select Code to Download


  1. or download this
    m{
      ^ # start of the string
    ...
        # no need to "$", because ".*" will happily swallow it all
      )
    }x
    
  2. or download this
    $ perl -MData::Dumper -le '%h = map { $_ => /^FOO((?!BA[RZ]$).*)/ ? $1
    + : q(does NOT match) } qw/FOO FOOZIM FOOBAR FOOA FOOBAZ FOOBARX/; $Da
    +ta::Dumper::Terse = $Data::Dumper::Indent = 1; print Dumper \%h'
    {
    ...
      'FOOBAZ' => 'does NOT match',
      'FOO' => ''
    }