Phantom

Egrep Metacharacter Summary 본문

프로그래밍에 대한 정보들

Egrep Metacharacter Summary

Ph4nt0m_ 2013. 4. 17. 13:22
반응형

정규식과 관련된 기본적인 메타케릭터 설명이다. Egrep을 기준으로 작성된거지만 대부분의 표준 정규식에서 지원된다.


MetachracterMatches
.dotMatches any one character
[…]character classMatches any one character listed
[^…]negated character classMatches any one character not listed
\charescape characterWhen char is a metacharacter,or the escaped combination is not otherwise special, matches the literal character

Items Appended to Provide "Counting" :The Quantifers

MetachracterMatches
?questionOne allowed, but it is optional
*startAny number allowed, but all are optional
+plusAt least one required; additional are optional
{min,max}specified rangeMin required, max allowed

Items That Match a Position

MetachracterMatches
^caretMatches the position at the start of the line
$dollarMatches the position at the end of the line
\<word boundary*Matches the position at the start of a word
\>word boundary*Matches the position at the end of a word

Other
MetachracterMatches
|alternationMatches either expression it separates
(…)parenthesesLimits scope of alternation, provides grouping for the quantifiers, and "captures" for backreferences
\1,\2..backreference*Matches text previously matched within first, second, etc., set of parentheses.

※ 참고자료
O'Reilly - Mastering Regular Expressions 2nd Edition


출처 - http://n3015m.tistory.com

반응형

'프로그래밍에 대한 정보들' 카테고리의 다른 글

기초명령어  (0) 2013.04.25
컴퓨터 구조론 질문?!  (0) 2013.04.21
세미콜론(;)과 파이프(|)의 차이점?!  (0) 2013.04.16
스왑을 주는 이유?  (0) 2013.04.16
What is FHS?  (0) 2013.04.14
Comments