Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Regex to match 20 chars of some digits followed by some spaces

by Enlil (Parson)
on Dec 19, 2003 at 07:24 UTC ( [id://315758]=note: print w/replies, xml ) Need Help??


in reply to Regex to match 20 chars of some digits followed by some spaces

In the spirit of TMTOWTDI:
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { chomp; print m/\d(?:(?:\d| (?!\d))){19}/ ? "$_ matches\n" : "$_ does not match\n"; } __DATA__ "01234567890123456789" "123" "123 123 " "123c " " " "11232424525252423 "

enlil

  • Comment on Re: Regex to match 20 chars of some digits followed by some spaces
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2025-01-18 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (56 votes). Check out past polls.