Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by Chmrr (Vicar)
on Dec 19, 2003 at 14:21 UTC ( #315798=note: print w/replies, xml ) Need Help??


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

Yet another way to do it: /^\d+ *(?<=^.{20})$/ That is, one or more digits, followed by zero or more spaces -- and only thereafter do we check that it summed to 20 characters total. Probably not as efficient (involves more backtracking) but easier for my eyes to understand.

  • 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
Node Status?
node history
Node Type: note [id://315798]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-01-18 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (211 votes). Check out past polls.

    Notices?