#!/usr/bin/env perl use strict; use warnings; use utf8; use open OUT => qw{:encoding(UTF-8) :std}; my @names = ("Zoë", "Zoë Åcçéñt-Smythe"); my $re = qr{(?x: ^ ( ( [\p{Alpha}'_-]+ ) [\s\p{Alpha}'_-]* ) $ )}; for my $name (@names) { my ($full, $first) = $name =~ $re; print "Name: $name\n"; print "First: $first\n"; print "Full: $full\n"; } #### Name: Zoë First: Zoë Full: Zoë Name: Zoë Åcçéñt-Smythe First: Zoë Full: Zoë Åcçéñt-Smythe