If I understand your question correctly, the problem isn't with your s///, it's with your initialisation of $value. It should be single-quoted, not double.
my $value = 'sample1\*sample2\*sample3*sample4*sample5'; $value =~ s#\*#STAR#g; print $value
Output:
sample1\STARsample2\STARsample3STARsample4STARsample5
In reply to Re: Regex problem
by FunkyMonk
in thread Regex problem
by siraj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |