in reply to Quick Regex Question
0:20 >perl -E "my $line = qq[asdf asdf asdf INC1234567 klasdv asf asd +f ]; if ($line =~ /INC\d{7}/ ) { say qq[yes]; } else { say qq[no]; }" yes
Your only mistake was in backslashing the curly brackets.
Update: Fixed typo: the second occurrence of $line was missing the sigil.
Athanasius <°(((>< contra mundum
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Quick Regex Question
by Anonymous Monk on Oct 08, 2012 at 14:31 UTC | |
by Athanasius (Archbishop) on Oct 08, 2012 at 14:37 UTC | |
by GrandFather (Saint) on Oct 08, 2012 at 23:29 UTC | |
by AnomalousMonk (Archbishop) on Oct 09, 2012 at 12:36 UTC |
In Section
Seekers of Perl Wisdom