I guess the answer is to turn the substrings you are looking for into regular expressions that accommodate the presence of '-' and '.' between the letters. For example,
#!/usr/local/bin/perl
$str = "a[-\.]*?b[-\.]*?c";
$str2 = "zzzza---..bcddddd";
$str2 =~ /($str)/;
print $1,"\n";
The use of the grouped regexp between /.../ allows you to remember the substring that matched the regexp.
But i'm not sure with that,can you please give some idea or give me your script if it's possible. |