Hi requinix and Thank you for taking time to reply,
i understand your reply but i wonder why you think that my expression is invalid? it is working on my xampp with php, so i assume that the expression is valid according to regex rules. I say this because it is actually doing what i want it to do, albeit, i need a second check to see if it falls into the non html coded word:
$checkname = 'Name Me';
//$checkname = 'NameMe';
//$checkname = 'Rückenseiten<wbr>­tiere';
//$checkname = 'Name Me';
$checktrue4 = 'Name<script>alert(\'Fuckoff\')</script>Me';
if (!preg_match("/^(?:^)(\p{L}){2,24}(\<wbr\>\­\;)?(\p{L}){2,24}?(?:$)$/", $checkname)) {
if (!preg_match("/^(?:^)(\p{L}){2,24}(\s)?(\p{L}){2,24}?(?:$)$/", $checkname)) {
echo 'checkname === 0';
} else {
echo 'checkname === 1';
}
} else {
echo 'checkname === 1';
}
try my code and uncomment each variable to test it. i seem to have accomplished all of my goals without ignoring code. Is this really invalid?