in reply to Re: Regex to delete high-bit characters
in thread Regex to delete high-bit characters
$ perl -v This is perl, version 5.005_03 built for sun4-solaris Copyright 1987-1999, Larry Wall ... $ perl -le '$_="abc"; print "ok" if (/^[[:ascii:]]+$/)' # (no output -- that char.class doesn't work) $ perl -le '$_="abc"; print "ok" if (/^[\x00-\x7f]+$/)' ok
The OP didn't actually say how far back he needs to go with his perl version(s), but I'm not surprised if 5.005 is part of his condition.
(Update: forgot to mention: that same sun4-solaris machine also has perl 5.8.0 installed as a non-default version, and the first one-liner works with that as expected:
$ perl5.8.0 -le '$_="abc"; print "ok" if (/^[[:ascii:]]+$/)' ok
|
|---|