in reply to Regex (find an * after a digit)

To expand a bit on NetWallah's remarks, if you are using 5.8.0, and have a locale-aware environment that happens to be set currently to "utf-8", then perl will try to interpret non-ASCII data as if it were utf-8 data by default, and you'd need to expressly tell it not to do that, via the "use bytes" and/or "no utf8" pragmas (or by changing your locale setting). See the "perluniintro" and "perlunicode" man pages if this applies to you.

You say you are not really doing any utf8 stuff, but it would appear that your text file contains non-ASCII data (e.g. latin1 "accented" characters). If the file uses the "upper table" of iso-8859-1, then the "0xb2" byte is a superscript "2". If it's some other character set, then it's probably some other "special" character. Or maybe it's just noisy data...

In any case, upgrading to 5.8.2 (the current version) will help. 5.8.0's "interpretive preference" based on the locale setting was ultimately viewed as a bad idea, and was changed in 5.8.1.

Replies are listed 'Best First'.
Re: Re: Regex (find an * after a digit)
by Anonymous Monk on Feb 06, 2004 at 05:39 UTC
    You know what. I never thought about the input. I'm using a file that's created by someone other than me. That person happens to be from another country (that uses the accented characters and eat bagettes)... I'll bet someone a coke that that's it.

    For the record, the machine that it DOES work on, is my machine -- has canna and kinput2 running at all time, and I go in and out of Japanese. The machine it doesn't work on is English only.

    Either way, the text file is an absolute mess, which is why I'm working on it in the first place.

    Cheers to everyone for their input!