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

[regex] PHP 정규표현식 패턴 24강 - \A (역슬래시 대문자A) : 문자열의 가장 처음 , \Z (역슬래시 제트) : 문자열의 가장 마지막

938  


 


 패턴 24  -  \A  :  가장 처음 줄의 시작
                   ^  :  각각의 줄의 시작

                  \Z  :  가장 마지막 줄의 끝
                    $  :  각각의 줄의 끝


※ 주의;  A와 Z는 대문자 사용해야 함.

Source

Ere iron was found or tree was hewn,    When young was mountain under moon;
Ere ring was made, or wrought was woe,    It walked the forests long ago.

Case 1  -  가장 첫 줄의 시작  3개의 문자

Regular Expression: \A...
First match: Ere iron was found or tree was hewn, When young was mountain under moon;
Ere ring was made, or wrought was woe, It walked the forests long ago.
All matches: Ere iron was found or tree was hewn, When young was mountain under moon;
Ere ring was made, or wrought was woe, It walked the forests long ago.

Case 2  -  가장 마지막 줄 끝 3개의 어떤 문자

Regular Expression: ...\Z
First match: Ere iron was found or tree was hewn, When young was mountain under moon;
Ere ring was made, or wrought was woe, It walked the forests long ago.
All matches: Ere iron was found or tree was hewn, When young was mountain under moon;
Ere ring was made, or wrought was woe, It walked the forests long ago.

 


분류 제목
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