Sorry, but I can't find any better words for this than STUPID:mad:! Are there any sitepoint moderators at work here? And where is a link to report abuse?
I came here for professional advice, but there seems to be a need for a basic regexp lesson, instead!
First of all, simple alternation - (\.|\?|\!) - is stuff in round brackets where the characters need to be separated by the pipe sign (|). In square bracketted character classes, on the other hand, there are NO pipe signs, since alternation is IMPLICIT!
In alternation notice the need to escape metacharacters - characters with a special use in regexp.
The same special characters, or metacharacters do NOT need to be escaped in character classes :nono: - the stuff between square brackets, because ANY character there is taken literarely!! (There are special positions for a closing square bracket / negation / end of string mark etc but let's leave them now..)
I left sitepoint forums years ago for these spammers and people who do not even bother to read a detailed description of a professional problem, but jot in their incompetent stuff like this!
By the way, do YOU know anything about look-arounds and things like atomic grouping?
Still waiting for expert help and an in-depth explanation for the failure of the regexp!