in reply to Re^2: Regex problem
in thread Regex problem

Does this help?
#!/usr/bin/env perl use warnings; use strict; my $value = '"sample1\*sample2\*sample3*sample4*sample5"'; print 'original string: ', $value, "\n"; $value =~ s#\\\*#STAR#g; $value =~ s/\"//g; # now remove double quotes print 'output string: ', $value, "\n";
Here is the output:
original string: "sample1\*sample2\*sample3*sample4*sample5" output string: sample1STARsample2STARsample3*sample4*sample5
I am assuming your original string already has double quotes in it.

Replies are listed 'Best First'.
Re^4: Regex problem
by johngg (Canon) on Aug 02, 2007 at 22:30 UTC
    $value =~ s/\"//g;      # now remove double quotes

    Minor point, double-quotes (and single-quotes) are not regular expression metacharacters so they don't need to be escaped.

    $value =~ s/"//g;

    would suffice.

    Cheers,

    JohnGG