Home >Backend Development >PHP Tutorial >List of regular expressions commonly used in form validation_PHP tutorial
Regular expression to match Chinese characters: [u4e00-u9fa5]
Match double-byte characters (including Chinese characters): [^x00-xff]
Regular expression to match blank lines:
[s| ]*
Regular expression matching HTML tags: /<(.*)>.*1>|<(.*) />/
Matching leading and trailing spaces Regular expression: (^s*)|(s*$)
Regular expression matching email addresses: w ([- .]w )*@w ([-.]w )*.w ([- .]w )*
Regular expression matching URL: ^[a-zA-z] ://(w (-w )*)(.(w (-w )*))*(?S *)?$
Is the matching account legal (starting with a letter, 5-16 bytes allowed, alphanumeric underscores allowed): ^[a-zA-Z][a-zA-Z0-9_]{4,15} $
Match domestic phone numbers: (d{3}-|d{4}-)?(d{8}|d{7})?
Match Tencent QQ numbers: ^[1-9]* [1-9][0-9]*$