#!/usr/bin/perl use strict; use warnings; my @strings = qw/aaa_gjh1_dfgdf_0009 aaa_gjh_0000 00000 aaa_fdsfs_000 +aaa_sdf_jdsh_01111/; print is_valid($_) ? '' : "no ", "match: $_\n" for @strings; sub is_valid { my $test = shift; return $test =~ /\Aaaa_\w{1,24}(?<=\D)\d{4}\z/; }
In reply to Re^2: Number of digits at the end of the string
by rowdog
in thread Number of digits at the end of the string
by isha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |