$name = qr{($title)?\W+($first)?\W+($middle)?\W+($last)}; #### #the title shall be extensible, ok my @titles = qw/LTC COL DR MS MR MISS/; my $title = join('|',@titles); $title = qr[(?:$title)\.]i; #case-insensitive match # first name: no restrictions? my $first = qr[\w+]; # middle initial my $middle = qr{(?:\s*[A-Z]\.)+}; # last name: no restrictions? my $last = qr[\w+];