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

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

2,607  


 


 패턴 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 86강 - 상속 (2/3) : 상속의 사용방법
JS-생코 JS 85강 - 상속 (1/3) : 상속이란?
JS-생코 JS 84강 - this (5/5) : apply와 this
JS-생코 JS 83강 - this (4/5) : 객체로서 함수
JS-생코 JS 82강 - this (3/4) : 생성자와 this
JS-생코 JS 81강 - this (2/5) : 메소드와 this
JS-생코 JS 80강 - this (1/5) : 함수와 this
JS-생코 JS 79강 - 전역객체
JS-생코 JS 78강 - 생성자와 new (3/3) : 생성자와 new
JS-생코 JS 77강 - 생성자와 new (2/3) : 객체생성
JS-생코 JS 76강 - 생성자와 new (1/3) : 소개
JS-생코 JS 75강 - 객체지향프로그래밍 (3/3) : 부품화
JS-생코 JS 74강 - 객체지향프로그래밍 (2/3) : 추상화
JS-생코 JS 73강 - 객체지향프로그래밍 (1/3) : 오리엔테이션
JS-생코 JS 72강 - 함수의 호출 (2/2) : apply의 사용
JS-생코 JS 71강 - 함수의 호출 (1/2) : apply 소개
JS-생코 JS 70강 - arguments (2/2) : function length
JS-생코 JS 69강 - arguments (1/2) : arguments란?
JS-생코 JS 68강 - 클로저 (closure) 4/4 : 클로저의 응용
JS-생코 JS 67강 - 클로저 (closure) 3/4 : private variable
23/35
목록
찾아주셔서 감사합니다. Since 2012