Here's how to do it with ereg_replace (I avoid perl regexes when possible, because I find posix regexes much simpler, and generally faster.)
$search = "\n{3}";
$replace = "*****";
$result = ereg_replace($search,$replace,$text);
Hope that helps. Note that [] brackets are used to hold a RANGE of characters, and since you aren't replacing BOTH \n and something else, you don't need them.
If you needed to replace both 3 \n and 3 \m with ***** then you could do it like this:
$search = "[\n\m]{3}";
Note the bound goes on the outside, since it bounds the TWO choices of \n or \m. Note however, that this regex would replace \n\m\n with ***** as well as any combination of \n or \m.
If you wanted to restrict it to JUST 3\n or 3\m, then you'd use a branch (i.e. | symbol) like so:
$search = "\n{3}|\m{3}";
I haven't tested those, so I won't guaranteed them as being syntactically correct, but they should be close enough to figure out what I mean and play a bit with it.
If you're on a linux box, use "man 7 regex" to get a nice little basic help page on posix regular expressions.