Re: Regex Problem

From: Date: Fri, 31 Jul 2009 20:01:59 +0000
Subject: Re: Regex Problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-296140@lists.php.net to get a copy of this message
Igor Escobar wrote: > The solution don't need to be with regex, if anyone can solve this with > other way will be very helpfull . > > > Regards, > Igor Escobar > Systems Analyst & Interface Designer > > + http://blog.igorescobar.com > + http://www.igorescobar.com > + @igorescobar (twitter) > > > > > > On Fri, Jul 31, 2009 at 2:23 PM, Igor Escobar <titiolinkin@gmail.com> wrote: > >> Hi Folks, >> I have a serious problem. >> >> must create a regular expression against all that is between single quote >> or double quotes. Easy? Ok, i know, but i need that "everything" must to be >> too an single quote or double quote. >> >> If i have this SQL command: >> >> SELECT * FROM TSTRENIC.MEI_ACESSO WHERE UPPER(DS_MEI_ACS) LIKE *'%NOME' >> ASD ' AS'ASD'%' *AND USUARIO = *'oaksdpokasd'asda'* >> ORDER BY DS_MEI_ACS >> ASC; >> >> SELECT * FROM TSTRENIC.MEI_ACESSO WHERE USUARIO_DATA BETWEEN *'2007-01-02' >> * AND *'2008-07-08'* >> >> Anyone have any idea? >> >> >> >> I need an expression which case the fields in bold. >> >> >> Regards, >> Igor Escobar >> Systems Analyst & Interface Designer >> >> + http://blog.igorescobar.com >> + http://www.igorescobar.com >> + @igorescobar (twitter) >> Not entirely sure I understand. You want to BOLD the things contained in quotes and you put the * there to show that? If so, this is not tested: $bolded = preg_replace('#([\'"])(.*?)\1#', '<b>\1\2\1</b>', $text); -- Thanks! -Shawn http://www.spidean.com

« previous php.general (#296140) next »