MatchGroupExample1.php File Reference

Go to the source code of this file.

Functions

 MatchExample1 ()


Function Documentation

MatchExample1 (  ) 

Definition at line 10 of file MatchGroupExample1.php.

00011 {
00012     $objMatch = new MatchGroup();
00013     $objMatch->addItemName( "Flatline" );
00014     $objMatch->addItemName( "Matrix" );
00015     $objMatch->addItemName( "Wintermute" , "artificial" );
00016     $objMatch->addItemName( "Case" , "hacker" );
00017     $objMatch->addItemRegularExpression( "M(.*)y" );
00018     $objMatch->addItemRegularExpression( "A(.*)e" );
00019     $objMatch->addItemRegularExpression( "Winter(.*)" , "machine" );
00020     $objMatch->addItemRegularExpression( "^Case$" , "cowboy" );
00021 
00022         if ( $objMatch->found( "Molly" ) !== true ) return false;
00023         if ( $objMatch->match( "Molly" ) !== true ) return false;
00024         if ( $objMatch->match( "Wintermute" ) !== "artificial" ) return false;
00025         if ( $objMatch->match( "Wintertime" ) !== "machine" ) return false;
00026         if ( $objMatch->match( "Case" ) !== "hacker" ) return false;
00027         if ( $objMatch->match( "Jackson" ) !== false ) return false;
00028         return true;
00029 }
00030 
00031 if( MatchExample1() === TRUE )
00032 {
00033         print "ok!";
00034 }


Generated on Sat Apr 7 14:19:11 2012 for CodeToDiagram by  doxygen 1.5.9