This rule cannot tell if there is a space at the end.

var reg = /(^1[3456789]\d{9}$)|(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)/
reg.test("13807011234                                  ");   //false
reg.test("111@qq.com                                 ");   //true


var reg = /(^1[3456789]\d{9}$)|(^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$)/

this rule is used to determine whether the mobile phone number or mailbox

when judging the mobile phone number, he has a space at the end and normally returns false
, but when judging the mailbox, the space at the end returns true,. What I need is false

.

what I need is to fail the regular judgment and directly prompt the format error, not to use the trim function to ignore spaces and submit the form

.

start and end with ^ and $, you write not only the space at the end of the line, but also the space at the beginning of the line will pass

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9ba4c-5c68d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9ba4c-5c68d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?