Home > Backend Development > PHP Tutorial > 正则擒获的疑问

正则擒获的疑问

WBOY
Release: 2016-06-13 11:28:49
Original
817 people have browsed it

正则捕获的疑问?
$str="a1234a";
$preg="/(\d){4}/i";

上面能够匹配4个连续的数,
那么里面的子表达式捕获的



是1(一个子表达式)?
还是1324(一个子表达式)?
还是1、2、3、4(四个子表达式)?

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