_ajaxMessage(1, '模板id必须由字母和数字组成', a"/> _ajaxMessage(1, '模板id必须由字母和数字组成', a">
Home > Backend Development > PHP Tutorial > php里惯用正则表达式总结

php里惯用正则表达式总结

WBOY
Release: 2016-06-13 12:08:00
Original
918 people have browsed it

php里常用正则表达式总结

1、必须由英文,数字组合而成的字符串:

 if(!preg_match("/^(([a-z]+[0-9]+)|([0-9]+[a-z]+))[a-z0-9]*$/i",$spend)){                 return $this->_ajaxMessage(1, '模板id必须由字母和数字组成', array());	             }
Copy after login

?2、由数字,英文字符与下划线:

  if(!preg_match("/^[a-zA-Z0-9_]*$/i",$spendCancel)){                return $this->_ajaxMessage(1, '您输入的消费撤销通知模板id不合法', array());	            }
Copy after login

?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template