$searchStr="NOT YET AVALIABLE"; # $var is the string in which u r trying to search the pattern $searchStr... if($var =~ /$searchStr/){ ## contains the string.. }else{ ### doesnt contain the string... }
The result of the =~ operation is one of the following: A nonzero value, or true, if the pattern is found in the string...0, or false, if the pattern is not matched to ignore case... if($var =~ /$searchStr/i) hope this solves u r query.. regs, sachin balsekar. Daniel Falkenberg wrote: >Hey All, > >I have a string here that may/maynot containg the words NOT YET AVALIABLE. How can I >using perl and regex look for a match for the above words. Would it be something >like the following... > >if (test =~ qw(NOT YET AVALIALBE)) { > print "Sorry not yet avaliable!"; >else { > print "Another Crud goes here...!"; > >} > > >Any ideas? I don't have to use the quoted words (qw) and would probably rather use a >regex as they way I can tell it not to match case. > >Thanks, > >Dan > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]