Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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.

Comment on Re: regexp question
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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2015-11-27 01:13 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (711 votes), past polls