• 회원가입
  • 로그인
  • 구글아이디로 로그인

[regex] PHP 정규표현식 패턴 15강 - 수량자 ─ { } (중괄호) - 문자 반복 횟수 특정

2,271  


 


 패턴 15  - { } (중괄호) - 문자 반복 횟수 특정

    {a}  :   딱 a숫자만큼 해당  - Case 1
    {a,b}  :  최소 a, 최대 b 숫자까지 해당  -  Case 2
    {a,}  :  최소 a 숫자 이상이면 해당  -  Case 3


Source

One ring to bring them all and in the darkness bind them


Case 1  -  어떠한 문자든 5개씩 반복

Regular Expression: .{5}
First match: One ring to bring them all and in the darkness bind them
All matches: One ring to bring them all and in the darkness bind them

Case 2  -  소문자 e , l , s  조합으로 최소1 최대 3개씩 반복

Regular Expression: [els]{1,3}
First match: One ring to bring them all and in the darkness bind them
All matches: One ring to bring them all and in thedarkness bind them


Case 3  -  소문자 a ~ z 중 최소 3글자 이상씩 반복

Regular Expression: [a-z]{3,}
First match: One ring to bring them all and in the darkness bind them
All matches: One ring to bring them all and in thedarkness bind them

 


분류 제목
JS-생코 JS 46강 - UI,API 그리고 문서 (1/2) : 수업소개
JS-생코 JS 45강 - 모듈 (5/5) : 라이브러리의 사용
JS-생코 JS 44강 - 모듈 (4/5) : 라이브러리란?
JS-생코 JS 43강 - 모듈 (3/5) : Node.js의 모듈화
JS-생코 JS 42강 - 모듈 (2/5) : 모듈화
JS-생코 JS 41강 - 모듈 (1/5) : 모듈이란?
JS-생코 JS 40강 - 객체 (3/3) : 객체지향 프로그래밍
JS-생코 JS 39강 - 객체 (2/3) : 객체와 반복문의 조우
JS-생코 JS 38강 - 객체 (1/3) : 객체의 문법
JS-생코 JS 37강 - 배열 (5/5) : 제거와 정렬
JS-생코 JS 36강 - 배열 (4/5) : 데이터의 추가
JS-생코 JS 35강 - 배열 (3/5) : 배열과 반복문의 조우
JS-생코 JS 34강 - 배열 (2/5) : 배열의 효용
JS-생코 JS 33강 - 배열 (1/5) : 배열의 문법
JS-생코 JS 32강 - 함수 (5/5) : 다양한 정의 방법
JS-생코 JS 31강 - 함수 (4/5) : 출력
JS-생코 JS 30강 - 함수 (3/5) : 입력
JS-생코 JS 29강 - 함수 (2/5) : 함수의 효용
JS-생코 JS 28강 - 함수 (1/5) : 함수란?
JS-생코 JS 27강 - 반복 (6/6) : 반복문의 중첩 (= 이중 반복문) ★★★★★
25/35
목록
찾아주셔서 감사합니다. Since 2012