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

Re: Regex Question

by schumi (Hermit)
on Jan 10, 2003 at 16:35 UTC ( #225854=note: print w/replies, xml ) Need Help??


in reply to Regex Question

I'd go about this in two steps: First remove any whitespace between letters, and then split the rest up into variables. Like so:

s/([a-z])(\s)([a-z])/$1$3/ig

will remove any whitespace as long as it is between letters. Then, let's fill the variables:

m/([a-z]+)\s(\d),?\s?([a-z]+)\s(\d)/ig

(Note the placement of the brackets.) This should put stuff into your variables in the way you want it.

--cs

There are nights when the wolves are silent and only the moon howls. - George Carlin

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2022-01-21 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?