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

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

2,625  


 


 패턴 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-서기 JQ 4강 - 허버메뉴
JS-서기 JQ 3강 - 이벤트, 이펙트 (=메서드)
JS-서기 JQ 2강 - JQUERY (제이쿼리) 다운로드, 외부링크, 기본구문
JS-서기 JQ 1강 - JQUERY (제이쿼리) 개념, CSS 선택자
JS-서기 JS 17강 - 허버메뉴만들기
JS-서기 JS 16강 - this객체, 조건분기, 속성설정
JS-서기 JS 15강 - CSS 선택자
JS-서기 JS 14강 - HTML CSS JS 혼용하기 (=getElementsBy 시리즈 = JS선택자) ★★★★★
JS-서기 JS 13강 - DOM (돔: Document Object Model 문서객체모델)
JS-서기 JS 12강 - 이벤트핸들러2 (event handler) - onload, onunload, / confi…
JS-서기 JS 11강 - 이벤트핸들러1 (event handler)
JS-서기 JS 10강 - 사용자정의함수 (조건, 경고창, 페이지이동) (function, if, alert, url,…
JS-서기 JS 9강 - 함수 제작 (= 사용자정의함수)
JS-서기 JS 8강 - for문 안쪽에 if문 사용 (= 행렬 표만들기 = 줄바꿈 = 줄바꾸기 = 줄변경 = 라인변…
JS-서기 JS 7강 - 모든 구구단 (= 중첩포문 = 이중포문 = 이단포문) (for double loop)
JS-서기 JS 6강 - 특정 구구단
JS-서기 JS 5강 - for반복문 흐름, 1~100 출력 및 합산 3
JS-서기 JS 4강 - else if 조건문, && 기호 의미
JS-서기 JS 3강 - 변수선언, prompt() 입력함수, if조건문, 사이트 이동 ★
JS-서기 JS 2강 - 변수 선언 및 출력
11/35
목록
찾아주셔서 감사합니다. Since 2012