Quote:
Originally Posted by ElfMage
You can do this:
I used preg_replace because I am more familiar with that, but you can easily adapt the patterns to ereg_replace.
Basically what the code above is (supposed to be) doing is:
* Find any series of characters that are not characters, = or : (0 or more), and capture that into \1
* Followed by 7 to 11 digits (not captured)
* Followed by any non-character or ., and capture it into \2
And then replace that with the captured groups \1, your message, and \2.
I think that you mentioned in your last post differs from your original post, but you get the idea, you can change this to suit your needs.
|
Thanks for ur trying to help me ... but
what I need it is diffrent
PHP Code:
$post['message'] = preg_replace(
'#([^a-z\=\:]*)[\d]{7,11}([^\w\.]*)#si',
'\1u can\'t post numbers\2',
$post['message']
);
This will replace
12345678.gif to
can't post numbers and this what I don't want it ...
I don't want replace these
1234567.gif
123455678.jpg
1245663.swf
=12345678