assert regex symfony
// src/Entity/Author.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class Author
{
/**
* @Assert\Regex(
* pattern="/\d/",
* match=false,
* message="Your name cannot contain a number"
* )
*/
protected $firstName;
}