Is it possible to add a mask to an email?

Is it possible to add a mask to an email?

I need to force the user's hand to not be able to write values ​not present in an email address like '&' or 'é'...

I have a regex that works very well:

->regex('/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ ');


Is it possible to have a mask with RawJs in the same way? Like this :

->mask(RawJs::make('/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/'));


In v2, we had the opportunity :

->mask(fn (Mask $mask) => $mask->pattern('00/00'))


Thanks
Was this page helpful?