Hi
I have some file that looks like this:
some row
/folder1/folder2/folder3/folder4/folder5 *.kuku.* noku
/folder1/folder2/folder3/folder4/folder5 *.kuku noku
another row
another row
if first line is absent I need to add it, if second line is absent I need to add only second line
I wrote regular expressions , but they are not really works:
if ($line =~ /(\*\.kuku\.\*\b)/) {do something}
if ($line =~ /(\*\.kuku\b)/) {do something else}
Any idea?
Thanks
\bonly matches on word boundaries.\*\.kuku\.\*\bwill never match because*is not a word character.You could change it to
\sso you match a whitespace.\*\.kuku\.\*\s