Matching a string between 4 and 128 characters with PHP and Regex September 23, 2022 1 Min Read 0 16 Matching a string between 4 and 128 characters with PHP and Regex. Works with preg_match and preg_match_all which use the PCRE Library. $string = "tutorial"; if (!preg_match('#^(.){4,128}$#', $string)) { echo 'The string you entered is invalid.'; } Categorized in: PHP Tagged in: characters, Patterns, pcre, php, regex Share Article:
PHP Code To Connect, Download and Upload Data from an FTP Server using ftp_login, ftp_put and ftp_get June 1, 2023