This discussion is archived
5 Replies Latest reply: Oct 5, 2006 2:09 AM by 60660 RSS

regex validation: valid matches not found

j4john Newbie
Currently Being Moderated
Hi

I'm trying to use a regex to validate the format (not the content!) of email addresses. The best regex if found for this so far is
^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
which I've tested using http://regexlib.com/RETester.aspx

Strings which produce matches using this tester fail validation when I use the same pattern as an item-level validation on an Apex page.

I know that there are some different regex dialects out there, so maybe that's the problem...

Can anybody help out with an explanation - or even a fix :) ?

Many thanks

john