Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

Hi,

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.


Comment on Re: Splitting multiple commands with regex failure
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-09-18 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (110 votes), past polls