You want to test for the existence of any of a class of characters.
A class of characters in a regular expression is called a "bracket expression" and it looks like this:
[egbdf]
That bracket expression lists five letters, any of which may appear. To make a regular expression that says "match if there is one or more from this set," you add a plus sign:
[egbdf]+
Because you want to include an apostrophe in your character class, we have to be careful in constructing the character string that is passed to ereg() or ereg_replace(). We have
'[,.+#\']+'
or
"[,.+#']+"
Either will work. In the first example, the ' is escaped by a backslash. The function never sees this, as it is "eaten" by PHP.
Try this:
if (ereg("[,.*+#']+",'I am I am')) echo "yes<BR>"; else echo "no<BR>";
It should print "no<BR>".
If you change "I am I am" to "I am, I am" it will print "yes<BR>".
There also are special character classes in regular expressions that you might find useful, such as
[:alnum:] which is shorthand for "any alpha or numeric character," and
[b-g] which means "any letter between b and g, inclusive.
And you can negate a class by using a caret as its first element:
[:alnum:] or [abdef] or [m-z]