메뉴 건너뛰기

프로그램언어

조회 수 18395 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
정규표현식(Regular __EXPRESSION__)이란 어떠한 값이 특정한 형태를 갖는지를 검사하는 도구로서

ereg는 문자열에 어떤 문자가 포함 되어 있는가를 검사하는 함수로



저장될변수 = ereg ("검사할 문자", "검사대상 문자열")



"검사대상 문자열"에 "검사할 문자"가 포함되어 있는지를 검사훈 후에, 포함되어 있다면 TRUE를,

포함되어 있지 않다면 FALSE를 리턴합니다.



ereg 함수는 영어의 대소문자를 구분하지만, eregi 함수는 대소문자를 구분하지 않습니다.



▣ 이메일 주소와 홈페이지 주소 체크하기



<?







$a=primato@naver.com;

$ex="^[-_a-z0-9]+(\.[-_a-z0-9]+)*@[-a-z0-9]+(\.[-a-z0-9]+)+$";

echo eregi($ex, $a);







$b="http://phpboy.hosting.paran.com";

$hx="^
http://[-a-z0-9]+(\.[-a-z0-9]+)*(/[^\\\/:\*\"<>\|]+(\.[^\\\/:\*\"<>\|]+)*)*/?$";

echo eregi($hx, $b);







?>

  1. No Image 23Dec
    by
    2016/12/23 Views 21970 

    파일 확장자 비교

  2. No Image 23Dec
    by
    2016/12/23 Views 19943 

    explode - 문자열 나눔

  3. No Image 23Dec
    by
    2016/12/23 Views 20050 

    정규표현식 매치를 수행 (preg_match)

  4. No Image 23Dec
    by
    2016/12/23 Views 19012 

    정규 표현식 검색과 치환 (preg_replace)

  5. No Image 23Dec
    by
    2016/12/23 Views 23847 

    $_FILES

  6. No Image 23Dec
    by
    2016/12/23 Views 19658 

    대소문자 바꾸기 (strtoupper, strtolower)

  7. No Image 23Dec
    by
    2016/12/23 Views 18950 

    문자열 뒤집기 (strrev)

  8. No Image 23Dec
    by
    2016/12/23 Views 18375 

    이스케이프 함수 (htmlentities)

  9. No Image 23Dec
    by 조쉬
    2016/12/23 Views 18395 

    정규표현식 검사 도구 (ereg, eregi)

  10. No Image 23Dec
    by
    2016/12/23 Views 18067 

    문자열의 태그를 그대로 출력 (htmlspecialchars)

  11. No Image 23Dec
    by
    2016/12/23 Views 20843 

    preg_match (정규표현식 매치를 수행합니다)

  12. No Image 23Dec
    by
    2016/12/23 Views 17522 

    문자열에서 태그를 제거 (strip_tags)

  13. No Image 23Dec
    by
    2016/12/23 Views 18907 

    문자열 찾기 (strstr)

  14. No Image 23Dec
    by
    2016/12/23 Views 20223 

    깨진 한글 체크

  15. No Image 23Dec
    by
    2016/12/23 Views 18847 

    로그인페이지에서 온 경우/로그인한 페이지로 이동

  16. No Image 23Dec
    by
    2016/12/23 Views 18812 

    문자열 치환 (str_replace)

  17. No Image 23Dec
    by
    2016/12/23 Views 18867 

    문자열 추출하기 (substr)

  18. No Image 23Dec
    by
    2016/12/23 Views 23943 

    $_SERVER 함수

  19. No Image 23Dec
    by
    2016/12/23 Views 19019 

    링크를 걸때 http 처리방법

  20. No Image 23Dec
    by
    2016/12/23 Views 19012 

    디렉토리 안의 파일의 내용들을 읽는 예

Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 Next
/ 17

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved