PHP preg_replace() question

joshg

Golden Member
Jul 3, 2001
1,359
0
0
Hey guys I've got this little problem I need some help it's got me stumped

I've got a preg_replace function on a string that looks kinda like this: TEXT#23423#9999#3453#5399993#

my preg_replace function is basically: preg_replace("#9999#", "#", "TEXT#23423#9999#3453#5399993#", -1)

so I am wanting this result: TEXT#23423#3453#5399993#

BUT instead this is what I'm getting: TEXT#23423###3453#53#3#

notice how for some reason it is ignoring my # delimeter... does anyone know how to work around this? I'm really stumped about this it's driving me crazy!! Thanks for the help!
 

joshg

Golden Member
Jul 3, 2001
1,359
0
0
ok I solved it by just using str_replace()

lol

but the question is would preg_replace() be faster for this? I imagine that these strings will be chock-full of data around 200-300 characters that it will be searching like this...