Home > Backend Development > PHP Tutorial > 请教一下php正则表达式

请教一下php正则表达式

WBOY
Release: 2016-06-23 13:35:31
Original
1030 people have browsed it

会员号为11位字母和数字组合,
前三位为“M15”后一位为”M”结尾。英文字母大小写可以忽略


回复讨论(解决方案)

/^M15[0-9a-z]{7}M$/i

$str='M15452s8f1M';if(preg_match('/^M15([A-Za-z0-9]{7})M$/i',$str,$m)){	echo 'OK';}else{	echo 'NO';}
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