in reply to Perl RegEx doubt

Omit the question marks as they vary the count.

#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 2; my $re = qr/....p./; like ('ABCDpF', $re, 'Should match'); unlike ('tp7avs', $re, 'Should not match');