[ create a new paste ] login | about

Link: http://codepad.org/I3q8CXx2    [ raw code | output | fork ]

rosiro - Perl, pasted on Sep 24:
1
2
3
4
5
6
7
8
9
10
11
12
#!perl -l
use strict;
use warnings;
use utf8;
sub check {
    $_[0] !~ /\A[\P{Cc}\r\n]{1,2048}\z/;
}
print 0+check("妥当な 文字列");
print 0+check("妥当な 文字列"); # fullwidth space
print 0+check("妥当な\t文字列");
print 0+check("妥当な 文字列\n");
print 0+check("\x{00}\x{01}\x{02}\x{03}");


Output:
1
2
3
4
5
0
0
1
0
1


Create a new paste based on this one


Comments: