Home > Backend Development > PHP Tutorial > 求正则,该怎么处理

求正则,该怎么处理

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:44:04
Original
902 people have browsed it

求正则
设一字符串为:
$s = 'KAETC56-600NC1213156600N31036 KA62A0098';

求三段结果:

ETC56-600N
2131
N31036 KA62A

注:结果的位置不会改变。

------解决方案--------------------

PHP code


KA([\w|-]{10})\w\d(\d{4})\d+(\w+)\s(\w{5}) <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
600
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