0
Dears,Symfony : ParamFetcher를 사용하여 전자 메일 매개 변수 유효성 확인
RequestParam에서 전자 메일의 유효성을 직접 확인하고 싶습니다. 나는 REGEX 이런 종류의 사용하고 있습니다 :
[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
을하지만 파서는
The parameter \"&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$\" must be defined.
가 어떻게 그런 이메일 것을 확인할 수 있습니다 요구 사항 옵션에 정규식을로드하지 못했습니다 :
/**
* @Rest\Patch(
* "v1/customer/update",
* name="Update a customer"
*)
* @RequestParam(
* name="email",
* requirements="email",
* description="The email of the user",
* strict=true
* )
*/
을
미리 감사드립니다.
특수 문자를 이스케이프 처리 할 수 있습니다. 작동하지 않으면 사용자 정의 유효성 검사기를 등록 할 수 있습니다. –