Return to Snippet

Revision: 10956
at January 19, 2009 10:54 by alli14404


Initial Code
preg_replace("/&(?![a-zA-Z0-9#]+;{1})/", "&", $str);


Test here: http://regexpal.com/
Regex: &(?![a-zA-Z0-9#]+;{1})
Test case: &  j&j  hh jk 8 $ &     nnj & dasasd E&P  d d&d  11

Initial URL

                                

Initial Description

                                

Initial Title
Regex ignore html entities but replace any '&' with &

Initial Tags
regex, php

Initial Language
PHP