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

求正则,该怎么处理

WBOY
WBOYOriginal
2016-06-13 13:44:04828browse

求正则
设一字符串为:
$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>
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