output:my $str = "//111.11.112.12/abc/main/myfolder/docs"; my $replace = "something"; $str =~ s#.+(?=/main)#$replace#"; print "str now = $str";
str now = something/main/myfolder/docs
In reply to Re: Regex for replacement
by davidj
in thread Regex for replacement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |