Welcome Guest, Not a member yet? Register   Sign In
Help for alpha_numeric_punct
#1

I'm trying to add Cyrillic as well as a new line but it doesn't work

PHP Code:
/**
 * Alphanumeric, spaces, and a limited set of punctuation characters.
 * Accepted punctuation characters are: ~ tilde, ! exclamation,
 * # number, $ dollar, % percent, & ampersand, * asterisk, - dash,
 * _ underscore, + plus, = equals, | vertical bar, : colon, . period
 * ~ ! # $ % & * - _ + = | : .
 *
 * @param string $str
 *
 * @return boolean
 */
 
public function alpha_numeric_punct($str)
 {
 
// @see https://regex101.com/r/6N8dDY/1
 
return (bool) preg_match('/\A[А-Яа-яA-Z0-9 ~!#$%\&\*\-_+=|:.]+\z/i'$str);
 } 
Reply


Messages In This Thread
Help for alpha_numeric_punct - by Secux - 10-06-2021, 12:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB