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

Re: Regex expert needed



On Tue, May 03, 2005 at 07:22:39PM +0100, Alan Chandler wrote:
> On Tuesday 03 May 2005 09:50, michael wrote:
> > On Mon, 2005-05-02 at 16:08 +0100, Alan Chandler wrote:
> ...
> > > 'This is a bad bad thing, but not as bad as it would be if \"x=5\", so
> > > thats it'
> 
> > Would be yet harder still if you correct your grammar and put the
> > missing apostrophe in penultimate word, viz "that's"
> 
> Oops - but in that case the string will be
> 
> that\'s   because it has already had the addslashes function applied to it.

True, but repeating the "stripslashes" would remove them without 
harming anything else.

$str="v1='That\'s mine, isn't it?' &v2='No, it\'s not!'";
parse_str($str);
print "v1: ".stripslashes(stripslashes($v1))."<br>";
print "v2: ".stripslashes(stripslashes($v2))."<br>";

David

-- 
David Jardine

"Running Debian GNU/Linux and
loving every minute of it."  -L. von Sacher-M.(1835-1895)



Reply to: