Home >Backend Development >PHP Tutorial >求正则表达式写法解决思路

求正则表达式写法解决思路

WBOY
WBOYOriginal
2016-06-13 11:48:591034browse

求正则表达式写法
1  $a="fweffeawf"    我要获取从第三个字母开始到第6个字母 怎么写? 就是effe
2  $b="www.baidu.com/aa/bb.php"    我想获取aa怎么写 获取bb.php又怎么写。。
------解决方案--------------------
完全不需要正则的东东。为何一定要正则?
substr($a,2,4);

basename($b);

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