NYCPHP Meetup

NYPHP.org

[nycphp-talk] Regex & Delimiter Trouble

Chris Bielanski Cbielanski at inta.org
Fri Nov 19 16:48:45 EST 2004


I've noticed some dodgy behavior using the ^ and \A patterns in
preg_replace() and didn't put enough effort into the issue (trivial internal
Wiki) to resolve it. I did manage to determine that [\r|\n] apperas to be a
suitable substitute for $.


Thanks,
Chris Bielanski
Web Programmer, 
International Trademark Association,
1133 Avenue of the Americas, 33rd Floor
New York, NY 10036
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org  
INTA -- 125 Years of Excellence



> -----Original Message-----
> From: Daniel J Cain Jr. [mailto:dan at cain.sh]
> Sent: Friday, November 19, 2004 4:41 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Regex & Delimiter Trouble
> 
> 
> Still getting the same warnings as before and the "DOH!" 
> after changing 
> the pattern to single quotes on my system
> 
> 
> On Nov 19, 2004, at 3:30 PM, Dan Cech wrote:
> 
> > Use single quotes, the $ is screwing up the regex.
> >
> > $pattern = '/^quantity[1-9][0-9]{0,2}$/';
> >
> > Dan
> >
> 
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
> 



More information about the talk mailing list