use strict; use warnings; my $file; foreach $file (@ARGV) { open (INFILE,"<$file") or die "Cannot open Input file\n"; while (<INFILE>) { s!(?:^|\w*/|\.\./)[^\s,@;:]*(?<=/)([^\s,@;:]+?)(?=[\s,@;:]|$)! +$1!g; # s!\.\.!!g; print "$_"; } close INFILE; }
In reply to Re: Okay, I know why is it failing
by tsk1979
in thread This regular expression has me stumped
by tsk1979
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |