I come across a php regular expression, mentioned below, I am not sure why \q\ is used in it, can anybody help me to understand this?
$strBuildTitle="SOME URL";
$patterns[0] = "/[^a-zA-Z0-9\q\ ]/";
$replacements[0] = " ";
$strBuildTitle = preg_replace($patterns, $replacements, $strBuildTitle);
I believe it tries to remove any non-alpha-numeric character from the given url, not sure why \q\ is used here. Is is related with removal of quotes?
\qand\aren’t valid escape sequences.In double quoted strings, it’s PHP’s policy to ignore those and replace them with their apparent value, meaning
\simply becomingand\qbecomingq. The latter case already being covered by[a-z].