words selection
am 02.09.2006 16:43:32 von TrutyHi,
Please help me,
I would like to realise a filtre to select only word in file with
caracteres include into this variable $carac_available;
but not caracteres include into this variable $carac_notavailable;
my name file is "dico.txt"
sample with $carac_available = 'eo'; and $carac_notavailable =
'hydngp';
word selected : close, mouve, ... because 'o' and 'e' is include into
this words and 'h', 'y', 'd', 'n', 'g', 'p' is not include into this
words.
content dico.txt :
doing
close
sunny
drugs
mouve
....
my code with problem :
open (FILE_ANSWER,"dico.txt.txt");
while ($ligne =
chomp($ligne);
if (($ligne =~ \[$carac_available]\) && ($ligne !~
\[$carac_notavailable]\) ) { print $ligne." | "; }
}
close FILE_ANSWER;
Please, can you please me ?