\p{Z} : any kind of whitespace or invisible separator. the idea here is that you look at the list to see what each one does and then either include it in that line or remove it.
@vrijvlinder you gave me this code before. it is allow to use SPACE, and All Special Char for Username.
now i want to Allow Only Leters, Numbers, _ (underscore) and . (dot)
if (!function_exists('ValidateUsername')) {
function ValidateUsername($Value, $Field = '') {
if (preg_match('/(^[ ]|[ ]{2}|[ ]$)/', $Value)) return FALSE; // JDJ Fail on leading, trailing or runs of spaces
return ValidateRegex(
$Value,
'/^([\d\w_ ]{3,40})?$/si' // JDJ Allow spaces and 40 char length
);
}
}
'/^([\d\w_ ]{3,40})?$/si' // JDJ Allow spaces and 40 char length
to:
'/^([\d\w_]{3,40})?$/si' // no spaces, from 3 - 40 letters and numbers, underscore allowed
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Yes as I explained before the list up there tells you what each one does so you can remove or add the ones you want. I think the one below will do what you want
@vrijvlinder said:
Yes as I explained before the list up there tells you what each one does so you can remove or add the ones you want. I think the one below will do what you want
'/^([\p{L}\p{N}\p{Pd}\p{Pc}]{3,20}+)?$/'
Is there a way to make this change this setting with plug-in? Or can plug-in change settings like this?
Comments
If you want to allow them to use a space you need to add \p{Z} that to the filter
'/^([\p{L}\p{N}\p{Pd}\p{Pc}\p{Lm}\p{M}\p{Z}]{3,20}+)?$/'
\p{Z} : any kind of whitespace or invisible separator. the idea here is that you look at the list to see what each one does and then either include it in that line or remove it.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder you gave me this code before. it is allow to use SPACE, and All Special Char for Username.
now i want to Allow Only Leters, Numbers, _ (underscore) and . (dot)
if you are using this, remove the space then
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Yes as I explained before the list up there tells you what each one does so you can remove or add the ones you want. I think the one below will do what you want
'/^([\p{L}\p{N}\p{Pd}\p{Pc}]{3,20}+)?$/'
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@peregrine Perfect. Thanx for Kindly Reply
@vrijvlinder Thank you too
Is there a way to make this change this setting with plug-in? Or can plug-in change settings like this?
Yes. plugins can add validations.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.