PHP 정규 표현식 10가지 사용 예제
Matching a Valid Email Address $email = 'editor@thedaily.com' if (!preg_match('^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$^', $email)) { echo 'The email address you entered was invalid.'; } Matching a string between 4 and 128 characters $string = "tutorial"; if (!preg_match('#^(.){4,128}$#', $string)) { echo 'The string you entered is invalid.'; } Matchin..
웹개발/Php
2011. 9. 6. 11:59