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

Gast wer
 2018-01-14 19:02
#187920 #187920
Merkwürdig das Script funktioniert bei mir:

test.pl:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl
use strict;
use warnings;

open(my $fh, '<:encoding(UTF-8)', './test.txt') or die($!);
while(my $line = <$fh>){
  if($line=~/\x{263a}/) {
    print "gefunden Smiley\n";
  }
  if($line=~/\x{1f91e}/) {
    print "gefunden Cossed Fingers\n";
  }
}
close($fh);


test.txt:
Code: (dl )
1
2
3
4
5
Hello u ☺
IS a tweet
ÄÖÜẞ
Yeah \o/
Finger

Last edited: 2018-01-14 19:26:29 +0100 (CET)

View full thread match anhand von unicode control code