regex issue

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

 



All I want to do is capture the keyword (array, break, echo, etc) and color
it.

 

---------------

$txt = "this is an array('test')";

 

$pattern = "/(array|break|echo|continue)([\(.|\s.|\;.])/";

 

echo preg_replace($pattern, '<font color="red">$0</font>', $txt);

----------------

 

This captures "array(" though and I just want "array".

 

 

Thanks for pointing out my stupidity,

Nate Sanden

nate@xxxxxxxxxxxxxxxx
http://www.savingadvice.com

 


[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