On Thu, 12 Apr 2018 17:26:57 +0100 Gary Stainburn <gary.stainb...@ringways.co.uk> wrote:
> I have a text file (created by pdftotext) that I've imported into my script. > > It contains ASCII characters 251 for crosses and 252 for ticks. If I load > the file in gvim and do :as > > it reports the characters as > > <u> 251, Hex 00fb, Octal 373 > <u> 252, hex 00fc, Octal 374 > > However, when I try to seacch for it using > > if ($line=~/[\xfb|\xfc]/) { > > or even just > > if ($line=~/\xfb/) { > > it always fails. What am I doing wrong? > Perhaps see http://perldoc.perl.org/perlunitut.html - you may need to read the file as binary or iso8859-1 or whatever. Also see https://github.com/shlomif/how-to-share-code-online and read what Andy noted. > Gary > -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ https://github.com/shlomif/what-you-should-know-about-automated-testing It’s easier to port a shell than a shell script. — http://en.wikiquote.org/wiki/Larry_Wall Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/