简体   繁体   English

这个正则表达式匹配什么?

[英]What would this regex match?

嗨,你知道这是什么,谢谢

preg_match('/^[1-8](0|5)$/', $myValue)

字符串开头,数字从1到8,捕获与0或5匹配的组,字符串结尾。

  • Start of string 字符串开始
  • A digit between 1 and 8 1到8之间的数字
  • Either a digit 0 or 5 0或5位数字
  • End of string 字符串结尾

This might be useful to you, enter the regular expression and view for yourself: 这可能对您有用,请输入正则表达式并自己查看:

http://strfriend.com/ http://strfriend.com/

The site will depict what a given regular expression will match 该网站将描述给定的正则表达式将匹配什么

它的发生匹配101520253035404550556065707580 ,或85 (具有尾部的换行符\\n如果存在的话) 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM