The following regex matches any Unicode Letters + Unicode Numbers + Vowel Signs + Dot + Dash + Underscore + Space
/^[\w\pN\pL\pM .-]+$/u
Works successfully.
I want to edit my regex so it accepts the following:
? ! ( ) % @ # , + - : newline
- represents negative sign.
My attempt doesn’t work:
/^[\w\pN\pL\pM .-**?!()%@#,+-:\r**]+$/u
Here is my snippet with latest attempt:
if(preg_match('/^[\w\pN\pL\pM .-?!()%@#,+-:\r]+$/u', $_POST['txtarea_msg']))
Any idea?
/^[\w\pN\pL\pM \?!\(\)%@#,\+\-:\n\r]+$/ushould do it.