Re: Regular expressions (regex) question for parsing

From: Date: Mon, 22 Dec 2008 21:23:35 +0000
Subject: Re: Regular expressions (regex) question for parsing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-284978@lists.php.net to get a copy of this message
On Mon, Dec 22, 2008 at 15:56, Rene Fournier <renefournier@gmail.com> wrote: > > Each line should start with a $dollar sign, then some arbitrary text, ends > with a percent sign, followed by carriage-return and line-feed. Sometimes > though, the final line is not complete. In that case, I want to save those > lines too. Just a quick note on that, Rene.... > $result = array ( "matches" => > array ( 0 => "$sometext %\r\n", If you want to have the dollar sign included, use single quotes. Double-quoted things translate the data enclosed within them, so "$sometext" would translate that into the value of the variable (or null with E_NOTICE if it's uninstantiated/undefined). Conversely, '$sometext' would be the literal $sometext. -- </Daniel P. Brown> daniel.brown@parasane.net || danbrown@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out!

« previous php.general (#284978) next »