Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: extended ascii regex

by seattlejohn (Deacon)
on Dec 11, 2002 at 05:54 UTC ( [id://219017]=note: print w/replies, xml ) Need Help??


in reply to extended ascii regex

Works fine for me, e.g.:
use strict; my @allow = ("\xA1","\x89","\x94"); my @disallow = ("\xB2","\xFF"); foreach my $char (@allow) { $char =~ s/[^0-9a-z\x80-\xA5_:,!\?\.\* -]//ig; print "wrong: char " . ord($char) . " should be allowed\n" if $char +eq ''; } foreach my $char (@disallow) { $char =~ s/[^0-9a-z\x80-\xA5_:,!\?\.\* -]//ig; print "wrong: char " . ord($char) . " should not be allowed\n" if $c +har ne ''; } exit;

(Tested on perl 5.6.1, ActiveState build 631, Windows XP.) Perhaps you could post some examples of specific input items that generate unexpected results?

        $perlmonks{seattlejohn} = 'John Clyman';

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://219017]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found