Thread Regex match nicht alle Emoji (12 answers)
Opened by GwenDragon at 2025-12-10 16:06

GwenDragon
 2025-12-10 16:06
#197363 #197363
User since
2005-01-17
14898 Artikel
Admin1
[Homepage]
user image
Ich wollte Emojis aus Unicode-text raus filtern.
Klappt irgendwie nicht.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
use 5.024;
use strict; 
use warnings;
use utf8;

my $str = "👽 👽 42";
my @c = $str =~ m/\p{Emoji}/g;

say "Länge: ", length($str), "\n", "Anzahl Emoji: ", scalar @c;


Code: (dl )
1
2
Länge: 6
Anzahl Emoji: 4


Warum 4?
Last edited: 2025-12-10 16:11:57 +0100 (CET)

View full thread Regex match nicht alle Emoji