Re: Regex Problem

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

 



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@xxxxxxxxx> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux