From: Prasad J. <pra...@sy...> - 2007-07-06 11:15:51
|
Hi All, This is the string I am passing to the expect "Do you want to uninstall depot \w+ from \w+ which is dependent" But, I am not getting why it is failling to match following line which is printed on the terminal. "Do you want to uninstall depot VRTSvxfs from slpam09 which is dependent" Basically, If I remove the regular expression strings from the inputed string to expect ie. remove \w+ with the exact word, then it is working fine. I am not getting what I have done wrong. Please help. <<<<<<<<<<<<<<<< PART OF THE CODE <<<<<<<<< push (@match_patterns, "Do you want to uninstall depot \w+ from \w+ which is dependent" ) ; $functions[$#functions+1] = \&send_yes ; my $expect = $cluster->getExpect ($hosts[0]); ##### this returns an expect object $expect->expect($timeout, '-re', "MyPrompt>"); #### THIS IS A CALL TO EXPECT. my ( $matched_pattern_pos, $error, $matched_str, $before_match, $after_match) = $expect->expect( $timeout, '-re', @match_patterns ) ; <<<<<<<<<<<<<<<< I am not able to use regular expression in the expect string. Please help. Thanks and Regards, Prasad. |