Return to Snippet

Revision: 34355
at October 21, 2010 13:16 by thefrosty


Updated Code
$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." ) );

Revision: 34354
at October 21, 2010 13:14 by thefrosty


Initial Code
$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." ) );

Initial URL


Initial Description
I\'m trying to find an expression to match a whole sentence. So really the pattern is the regex of the subject.

Initial Title
RegEx match whole sentence.

Initial Tags
regex

Initial Language
Regular Expression