SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    quotes substitution

    Code:
    #!/usr/bin/perl
    $line="” 3”";
    $line =~ s/[&|&amp\;]rdquo;/'/g;
    print $line;
    I have to substitute or ” with single quotes. Now the output I get from the above code is ' 3&amp' Where the expected output should be 3.

  2. #2
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe this will meet your requirements:

    Code:
    $line="” 3”";
    $line =~ s/&(amp;)?rdquo;/'/g;
    print $line;


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •