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

Re: regexp question

by virtualsue (Vicar)
on Dec 29, 2006 at 11:16 UTC ( #592205=note: print w/replies, xml ) Need Help??


in reply to regexp question

Try replacing the space character in your match with "\s*". The '*' says to match a whitespace character 0 or more times.

Replies are listed 'Best First'.
Re^2: regexp question
by deibyz (Hermit) on Dec 29, 2006 at 11:46 UTC
    That would also match words of more than 20 chars "splited", making \s* = "".

    If I had to keep this limitation I would do:

    my @a = grep { /^.{1,20}$/ } split " ", $string

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://592205]
help
Chatterbox?
Discipulus played the guitar in a ska band 12 elemnts, very fun
[LanX]: well ... the prize for worshipping satan is high ...
[Discipulus]: you value too much your soul LanX
[Eily]: LanX: you mean people end up losing their health insurance?
LanX could be a reference to Trump and/or Brexit ...
[LanX]: ... anyway getting a support call from food! Need to respond ... ;-)
LanX see you later

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (14)
As of 2017-03-24 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.