Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: Reg Exp

by prasadbabu (Prior)
on May 26, 2008 at 09:46 UTC ( #688506=note: print w/ replies, xml ) Need Help??

in reply to Re: Reg Exp
in thread Reg Exp

Hi psini,

That solution seems to be not fit here. In the 'test1' string, there is no parantheses to split, so it will obviously fail and you can't split the string.

OP wants to match the 'test1' string where the platform is missing and which is present in 'test' string.


Comment on Re^2: Reg Exp
Replies are listed 'Best First'.
Re^3: Reg Exp
by psini (Deacon) on May 26, 2008 at 10:01 UTC

    Yep, I realized it reading the other answers, sorry

    Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.

Re^3: Reg Exp
by chrism01 (Friar) on May 27, 2008 at 07:20 UTC
    Actually, IFF (if and only if) there are only the 2 variations presented in the OP, you could just use a

    @arr=split(/ /,$test);

    ... and count the size of the array


    if its 4, arr[2]is the OS, otherwise no OS was specified

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2015-12-01 06:09 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 (794 votes), past polls