in reply to Re: character encoding ambiguities when performing regexps with html entities
in thread character encoding ambiguities when performing regexps with html entities

So thankfully, it turns out that the problem i was trying to solve was still causing me grief. what happens to $text is that it gets dumped to another text file that describes the LaTeX sans comments, extraneous spacing, etc. That file is then searched for plaintext for web display, which is why i wanted to substitute the LaTeX tags for html entities. One of my coders was using straight unicode in the .tex files, and I felt that was a bad idea (mostly since we want to keep it simple), so that's why I'm doing this simple workaround.

On a related note, is there a regular expression I can write that detects non-ascii characters? I really don't want to parse through a few ten thousands of LaTeX code...

  • Comment on Re^2: character encoding ambiguities when performing regexps with html entities

Replies are listed 'Best First'.
Re^3: character encoding ambiguities when performing regexps with html entities
by graff (Chancellor) on Sep 24, 2007 at 22:27 UTC
    is there a regular expression I can write that detects non-ascii characters?

    Here are a couple easy ones:

    /[^\x00-\x7f]/ /[^[:ascii:]]/
    They both work whether or not the string happens to have its "utf8 flag" turned on.