How to do Conact form 7 name field validation? [closed]

According to the documentation you have to create a custom filter to support it – you can do it like this:

add_filter( 'wpcf7_validate_text*', 'custom_text_validation_filter', 20, 2 );

function custom_text_validation_filter( $result, $tag ) {
    if ( 'your-name' == $tag->name ) {
        // matches any utf words with the first not starting with a number
        $re="/^[^\p{N}][\p{L}]*/i";

        if (!preg_match($re, $_POST['your-name'], $matches)) {
            $result->invalidate($tag, "This is not a valid name!" );
        }
    }

    return $result;
}