HI Guys why doesnt this reg.exp work ?
The ‘TEST’ should be replaced with XXX ?
<?php
$Rules = array ('@<script[^>]*?>.*?</script>@si',
'@(TEST);+@e');
$Replace = array ('',
'XXX'
);
$data ="this is a TEST string";
$data = preg_replace($Rules, $Replace,$data);
echo $data;
?>
Your regex is
(TEST);+which matches the lister stringTESTfollowed by one or more of+.Since there are no
;in your string$data, the match never happens.