use Custom; # in this file we use a module that defines # a custom unicode character in the private area # and use that character in perl regular expression my $name = "\x{0xE001}alabala"; if ($name =~ /^\N{custom_char_name}/) { warn "custom character matched"; } # we could also print the character -- the name is subsituted with the character # at compile time print "The custom character is \N{custom_char_name}\n"; # using an undefined character causes a compile-time error. #$name=~ /\N{unknown_char_name}/; 1;