正则表达式匹配整个句子。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了正则表达式匹配整个句子。相关的知识,希望对你有一定的参考价值。
I\'m trying to find an expression to match a whole sentence. So really the pattern is the regex of the subject.
$subject = "Check out the newest #WordPress premium theme marketplace"; $pattern = "/Check out the newest #WordPress premium theme marketplace http://themelit.com/$"; if ( preg_match_all( $pattern, $subject, $matches ) ) $msg = array( "code" => "success", "message" => __("Thanks for tweeting!" ) ); else $msg = array( "code" => "error", "message" => __("You haven't tweeted anything yet." ) );
以上是关于正则表达式匹配整个句子。的主要内容,如果未能解决你的问题,请参考以下文章