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

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

1,418  


 


 패턴 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 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