Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^4: replace string

by sandy1028 (Sexton)
on May 18, 2009 at 10:30 UTC ( #764625=note: print w/replies, xml ) Need Help??

in reply to Re^3: replace string
in thread replace string

The input is
<b></b>Officially called <>“events,”< +/a> as "never events"
the string should be converted to
<b></b>Officially called <>“events,”< +/a>as "never events"
How can I convert only such characters.

Replies are listed 'Best First'.
Re^5: replace string
by ig (Vicar) on May 18, 2009 at 10:43 UTC
    use strict; use warnings; my $input = "<b></b>Officially called <>“event +s,”</a> as "never events""; print "input: $input\n"; $input =~ s/“/“/g; # change the lines $input =~ s/”/”/gi; $input =~ s/’/’/gi; print "processed input: $input\n";


    input: <b></b>Officially called <>“events,&rdq +uo;</a> as "never events" processed input: <b></b>Officially called <>“e +vents,”</a> as "never events"

    This was done using your REs and appears to provide the output you are looking for.

Re^5: replace string
by Anonymous Monk on May 18, 2009 at 10:42 UTC
    Better idea would be to provide hex dump of data, so we know what the actual bytes are
    echo |hexdump 00000000: 45 43 48 4F 20 69 73 20 - 6F 6E 2E 0D 0A |ECHO is o +n. | 0000000d;
    echo |od -tx1 0000000 45 43 48 4f 20 69 73 20 6f 6e 2e 0d 0a 0000015

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://764625]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2023-09-23 17:20 GMT
Find Nodes?
    Voting Booth?

    No recent polls found