in reply to Re^2: Regexp issue
in thread Regexp issue

Previous advice from others about using a module notwithstanding, this additional requirement puts it well into "If it gets any fancier" territory. Here, therefore, is the test:

use strict; use warnings; use Test::More; my @good = ( '"18/02/2018"', '"""18/02/2018"' ); my @bad = ( '""18/02/2018"' ); my $re = qr/^"("")?[^"]/; plan tests => @good + @bad; for my $str (@good) { like ($str, $re, "$str matched"); } for my $str (@bad) { unlike ($str, $re, "$str not matched"); }