Discussion:
Mask double quotes in @Assert\Regex()
Achat
2012-01-04 19:20:51 UTC
Permalink
Hi,

I like to use double quotes in the regex validation via annotations.

Example:

@Assert\Regex(
pattern="/^[^<>')(;\"]*$/",
message="Some error message"
)

But the pattern symfony2 uses is

"/^[^<>')(;\"

Everything after the second double quotes is cut of.

How can I mask the double quotes inside the annotation?

Thanks for help.
Maksym Hlukhovtsov
2014-09-09 14:28:18 UTC
Permalink
this might
help http://stackoverflow.com/questions/9173669/using-the-quote-characters-in-a-symfony2-regex-validator
Post by Achat
Hi,
I like to use double quotes in the regex validation via annotations.
@Assert\Regex(
pattern="/^[^<>')(;\"]*$/",
message="Some error message"
)
But the pattern symfony2 uses is
"/^[^<>')(;\"
Everything after the second double quotes is cut of.
How can I mask the double quotes inside the annotation?
Thanks for help.
--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2-/***@public.gmane.org
To unsubscribe from this group, send email to
symfony2+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Loading...