in reply to Regex doubt

Sorry For the choas,
I have a line with the string "TelecommuterTrac\WebIntHitList3" and using regular expression i want it to subtitute "country" into that line. I tried many ways what all the monks said..but ended up in vein. So can any one give the exact working code...See below for more info
$line = "this is TelecommuterTrac\WebIntHitList3"; I want it to be "this is country"
I understood the problem..i need solution for it..it would be better if i get the working code...
-Prasanna.K

Replies are listed 'Best First'.
Re^2: Regex doubt
by borisz (Canon) on Jul 29, 2005 at 09:34 UTC
    Your problem is, \W is a unknown escape sequence, so use ' not ".
    $line = 'this is TelecommuterTrac\WebIntHitList3'; $line =~ s/\QTelecommuterTrac\WebIntHitList3/country/; print $line __OUTPUT__ this is country
    Boris
Re^2: Regex doubt
by blazar (Canon) on Jul 29, 2005 at 09:21 UTC
    AFAIK there's no special \W escape sequence. Thus $line boils down to "this is TelecommuterTracWebIntHitList3". HTH