Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Number of digits at the end of the string

by isha (Sexton)
on Jan 18, 2008 at 05:54 UTC ( [id://663012]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Number of digits at the end of the string
in thread Number of digits at the end of the string

Thanks for the solution but this still says Match for aaa_fgjkghd11_hfksdh11__0000 ( two underscores)
  • Comment on Re^3: Number of digits at the end of the string

Replies are listed 'Best First'.
Re^4: Number of digits at the end of the string
by grinder (Bishop) on Jan 18, 2008 at 10:27 UTC

    Well -- to you, talk about ungrateful. It would be better to state more clearly what you want up front.

    Adding this additional constraint changes the pattern but a little. Were you to study perlre, you could probably have done it yourself.

    sub is_valid { my $test = shift; return $test =~ /^aaa_\w{1,24}(?<!_)_\d{4}$/; }

    • another intruder with the mooring in the heart of the Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://663012]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 02:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found