I want to regex value to mysql database using PHP:
Regex is added via php form:
/^(?:http:\/\/|https:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
it gets automatically converted to :
/^(?:http://|https://)?(?:www.)?(?:youtu.be/|youtube.com/(?:embed/|v/|watch?v=|watch?.+&v=))((w|-){11})(?:S+)?$/
Why it isn't same as what we have in database?