preg_match fails to resolve variable as a subject

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been scratching on this for some time now, and throughout I've been trying subscribe to this list.

Pardon if this is a stupid question, but I googled for days on this and still couldn't get it to work.

Is there a known issue with php's preg_match? I can get it to work on a string directly, but if I use a variable it fails with no match. pcretest works, and the variable prints correctly. I also used a number of online regex testers and worked, one gave me the basis of the code.

I can only post a piece of the code as I don't wish to offend, give you some clue as to how far strung I am.

preg_match("/(\d{1,3})(\.)$/", exec($mixer . ' ' . $command), &$matches)

I've separated the command so it outputs to a variable, and placed the variable as the subject with the same result. It also fails with system() as well.

A little light on the subject (pardon the pun :) ) would be very helpful. I know its very simple code, but its just a base to something else.


Cheers

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux