I got that error when I included a wildcard match like * outside of a brackets I believe it was....
suggestion and good practice until you are a god with regexps...
start small and work bigger
start with ereg("[0-9]",$t) and get that matching a basic # and then work that up as you go adding more functionality to it