| |

VerySource

 Forgot password?
 Register
Search
View: 656|Reply: 1

Questions about regular expressions

[Copy link]

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-22 00:40:01
| Show all posts |Read mode
What is the regular expression of email in POSIX, I wrote
eregi ('^ ([_. 0-9a-z]) + @ ([_ 0-9a-z-]) +. ([0-9a-z _-.]) +', "luan78zao@hotmail.com" , $ validated);
But return is false, is there an error? Also shown on the page
Warning: eregi () [function.eregi]: REG_ERANGE in C:\AppServ\www\finalProject\validatePage.php on line 8
What does this mean? Thank you all masters
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-6 06:30:01
| Show all posts
The period symbol matches all characters, including spaces, tab characters, and even newlines.
Hyphen ("-") It represents a range.
Therefore, to match these two characters, use "\" to escape
The proper expression can be
eregi ("^ [_\.0-9a-z-] + @ ([0-9a-z] [0-9a-z-] +\.) + [az] {2,3} $", 'luan78zao @ hotmail.com ', $ validated);
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list