in reply to Re^3: substituting 1 escaped character for another
in thread substituting 1 escaped character for another

Yes, good thinking there. More guessing:

The string may have 'non-printable' characters, it may have been copied and pasted from an editor that contains the characters (that are not visible but are actually there. Something like this kept me awake one night).

This may also be Unicode related. Did some googling, found a good example here: https://www.soscisurvey.de/tools/view-chars.php

  • Comment on Re^4: substituting 1 escaped character for another

Replies are listed 'Best First'.
Re^5: substituting 1 escaped character for another
by Marshall (Abbot) on Jul 26, 2018 at 23:03 UTC
    I think we just need more info about what the OP actually has. All of these Unicode and HTML problems can be solved. The problem statement as it exists is not correct - the OP's code "works", albeit not the best. I have often had to resort to viewing a file in binary to find "hidden" characters. That is one possibility although I don't think this is likely if this is an HTML page that properly renders in a browser.

      Don't assume that HTML cannot have weird characters

      I was scanning a web page one time and this is how one of the lines of my code ended up to be:

      if ( $tmpTxt =~ /\<option value=\"$c2\.php\?blue\=(.+?)\"/ ) { # rem +oved the \> because for some there is some kind of weird character b +etween the " and the > print $filehandle $1 . "\n" ; }
        There are lots of possibilities - let's see what the OP has.