You can do this:
PHP Code:
$message = preg_replace(
'#([^a-z\=\:]*)[\d]{7,11}([^\w\.]*)#si',
'\1u can\'t post numbers\2',
$message
);
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.