Recent Posts

Caution: Greetings to all visitors. The site is working in short. Links Please skip the link to view any topic and thank you for visiting
header ads

parser problem

Hello,

I have an actual issue this time. My parser uses a simple preg_match method, but it's matching more than one command. 'unseath from left' is matched with 'remove left.' I know this is got to be common, but I'm not sure of the fix.

class CommandParser
{

    private $command;

    public function parseCommand($prompt)
    {
            
        $commands = array(
                        array("command" => "item info", "regex" => "/system item info token (?<token>\w+) table...
Code (markup):
parser problem

from PHP http://bit.ly/2IsAQIc
via IFTTT

Post a Comment

0 Comments