> This is untested, but something like... > $str = "[hi] there, this is me [HI] there, this is me"; > $newstring = ereg_replace("(\[[A-Z]*])", "<br>\\1", $str); > should do it. > using the Perl regexe's might make it easier, but that should work.
That worked perfectly. Is there any way I can make it so that it'll put the <br> there in every instance except for when it's preceded by another square bracket. So this: [hi] there, this is me [HI] there, this is me would turn into this: [hi] there, this is me <br>[HI] there, this is me (which is the script that you sent me and works beautifully) but this: [hi] there, this is me [HI][HI] there, this is me won't turn into this: [hi] there, this is me <br>[HI]<br>[HI] there, this is me ? Chris -still learning regular expressions