[PHP] Re: Help with regular expresions! [ASAP]

2001-07-25 Thread James Holloway
Hi Peter, You could try this: italic Blah bold"; $new_string = preg_replace("//i", "", $string); echo "$string$new_string"; ?> preg_replace = regular expression replacement .* is greedy... Match any character . as many times * as necessary, made less greedy because the ? looks for whatever

[PHP] Re: Help with regular expresions! [ASAP]

2001-07-25 Thread maatt
$tag_name = "input"; $new_class = "yourclass"; eregi_replace("(<$tag_name)", "\\1 class=\"$yourclass\"", $yourstring); will work for simple cases, but isn't going to give you much more power than just applying a style to the tag iself - 'input { border : 1px }' say). If the design is consistent