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

Re: Splitting multiple commands with regex failure

by 2teez (Priest)
on Aug 24, 2012 at 07:43 UTC ( #989440=note: print w/replies, xml ) Need Help??

in reply to Splitting multiple commands with regex failure


To start with check this line:

if $command ne "") { ## Oops ... ### should be if ($command ne "") { ...
..(It parses the first parameters, like "command=!book this is my test book !number 1222223 !book another book" will just split out "!book this is my test book", and ignore the rest.

If you want just !book this is my test book, then you might have to check your regex again!!!
Beacuse this: m/(!\w+\s?.+?)(?=!\w)/simg; was just doing it job. Really.

Please also check this: # (!\w+\s?)(.+?(?=!\w)) is the original regex I was using
That was no where in your code as indicated in the original post. so this print "Command 3 is $3\n\n"; will cry foul!!! As this m/(!\w+\s?.+?)(?=!\w)/simg; is not equal to m/(!\w+\s?)(.+?(?=!\w))/;
Knowing that your data is unknown.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2017-02-23 01:00 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (338 votes). Check out past polls.