求一简单的正则表达式

WBOY
Release: 2016-06-23 14:10:27
Original
890 people have browsed it

preg_match_all('/字符串开始(.*?)回车/Us', $snoopy->results,$snoopy->results);
在分析网页的时候,我用上面的表达式截取“字符串开始”和回车之间的那个字符串。 这个回车应该怎么写呢? 我怎么写都不对, 郁闷死了


回复讨论(解决方案)

preg_match_all('/字符串开始(.*?)\s*/Us', $snoopy->results,$snoopy->results);

\r表示回车,\n表示换行

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