Warning: preg_match(): Unknown modifier

A

Anonymous

Guest
My script did work at one time, but it doesn't now.
This is the line that is throwing a wobbly:
if(preg_match("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $from)) {
I cannot see or find what is cousing the problem. This is the error message:
Warning: preg_match(): Unknown modifier '(' in /home/ukzone/in-uk.uk/html/calendar/register-exec.php on line 205
Can anybody help me with this problem?
Thanks,

John C
 
Are you sure
Code:
if(preg_match("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $from)) {
is line 205?
 
YES.
That is definately line 205.
It is a long script used for accepting input from the form. Then the script sends an email to ME ($from). that email is then returned with the validation.
This is when I get the error message.
I have to say though, that it wasn't always faulty. The script did work originally, but I cant remember whar I got the script from so I can't check it.
 
I forgot to mention that if I replace the above code with:
Code:
if(preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $from)) {
The script does work.
 
I am happy I have discovered your post. I was perusing audits on pay to write essay and keeping in mind that perusing audits on the web, I have discovered your post. I have an application yet I am not getting numerous guests on my application so I am pondering creating it.
 
I'd be happy to write about spam, spammers and spam posts, how does that sound. I'm sure that I could knock up 500 words, or more, or less whatever to suit your supposed criteria.
 
Your regular expression must be "delimited" by a pair of characters. Some examples are "/", "#", and "[" "]". Noarmlly I use "/" as it doesn't clash with other regex syntax. Replace your pattern with this:

Code:
/([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)/

Note the "/" at the start and end.
 
Back
Top