开发者

What is the equivalent of Python's "findAll" function in PHP?

开发者 https://www.devze.com 2022-12-10 01:50 出处:网络
re.findall(r\'(\\b[a-zA-Z][a-zA-Z0-9-]*)开发者_C百科(?=\\.com\\b)\', DATA) how would this line be in PHP?I think you\'re looking for preg_match_all.preg_match_all(\'/(\\b[a-zA-Z][a-zA-Z0-9-]*)(?=.co
re.findall(r'(\b[a-zA-Z][a-zA-Z0-9-]*)开发者_C百科(?=\.com\b)', DATA)

how would this line be in PHP?


I think you're looking for preg_match_all.


preg_match_all('/(\b[a-zA-Z][a-zA-Z0-9-]*)(?=.com\b)/',$data,$matches);


You might want to check out http://php.net/preg_match_all

0

精彩评论

暂无评论...
验证码 换一张
取 消