Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: problems splitting string

by VSarkiss (Monsignor)
on Dec 15, 2005 at 16:05 UTC ( #517000=note: print w/replies, xml ) Need Help??

in reply to problems splitting string

You want to split on a space only if followed by a digit, correct? This will do the trick:

@res = split /\s(?=\d)/, $string;
If there can be more than one digit, change that to:
@res = split /\s(?=\d+)/, $string;
You can find more on zero-width assertions in perlre.

Replies are listed 'Best First'.
Re^2: problems splitting string
by Anonymous Monk on Dec 15, 2005 at 16:08 UTC
    thanks for the help

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://517000]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2017-06-29 09:23 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (657 votes). Check out past polls.