preg_match fails to resolve variable as a subject

From: Date: Fri, 26 Nov 2010 00:07:05 +0000
Subject: preg_match fails to resolve variable as a subject
Groups: php.general 
Request: Send a blank email to php-general+get-309678@lists.php.net to get a copy of this message
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

« previous php.general (#309678) next »