How do you use unicode and regex with a short example?

unicode, regex, perl, example, programming
This example demonstrates how to use Unicode and regular expressions in Perl to match and manipulate strings.
#!/usr/bin/perl use strict; use warnings; use utf8; # Sample string with Unicode characters my $string = "Hello, 世界!"; # "Hello, World!" in Chinese # Regex to match Unicode characters if ($string =~ /[\p{Han}]/) { print "The string contains Unicode characters.\n"; } else { print "No Unicode characters found.\n"; }

unicode regex perl example programming