I hate it when I don't get it!
Ok, that kinda makes sense. So in this example which I use use validate e-mails:
if(!preg_match('/^[A-z]+\.[A-z]+@work.org$/',$value))
the + sign is actually saying 1 or more characters? I thought it was saying "Accept anything between A-z and a period and anything after that period within A-z and it must contain @work.org.
Is this not the case then?
Also,
your posted solution reads:if (!preg_match('/[a-zA-Z'.-]*$/',$value))
Why do I not have to escape the apostrophe?
Would if (preg_match('/[a-zA-Z.\'-]*$/',$value))
work too?