Home >Backend Development >PHP Tutorial >Use regular expressions to match multiples of 3

Use regular expressions to match multiples of 3

WBOY
WBOYOriginal
2016-07-25 08:47:211432browse
Code comes from: http://www.zhihu.com/question/24824487

It is recommended to use Regexp Match Tracer to test regularity
  1. ^[0369]*(([147][0369]*|[258][0369]*[258][0369]*)([147][0369]*[258][0369]*) *([258][0369]*|[147][0369]*[147][0369]*)|[258][0369]*[147][0369]*)*$
Copy code
Use regular expressions to match multiples of 3


Statement:
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