Thread match anhand von unicode control code (10 answers)
Opened by miwieg at 2018-01-14 13:05

miwieg
 2018-01-14 16:13
#187912 #187912
User since
2006-07-16
59 Artikel
BenutzerIn
[default_avatar]
Demnach wäre das für den Smiley (\x{263a}):

Code: (dl )
1
2
3
4
5
6
7
8
9
open(INF,"<:utf8",$infile);
while(my $line = <INF>){
chomp($line);
my $stringToCompare = pack "U", 0x263a;
if($line =~ /$stringToCompare/){
print "MATCH IN LINE: $line\n";
}
}
close(INF);


Das funktioniert aber nicht. Es gibt keine Treffer.

Ich vermute stark, ich habe die "pack"-Funktion nicht wirklich verstanden?

View full thread match anhand von unicode control code