차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
tech:regex [2014/08/27 05:41] – [반복] V_Ltech:regex [2016/07/12 00:56] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
 +{{tag>tech regex}}
 ====== 정규식 (Regular expression)====== ====== 정규식 (Regular expression)======
  
 |.|Any character except newline. | |.|Any character except newline. |
 |\\.|A period (and so on for \\*, \\(, \\\\, etc.) | |\\.|A period (and so on for \\*, \\(, \\\\, etc.) |
-|^|The start of the string. |+|%%^%%|The start of the string. |
 |$|The end of the string. | |$|The end of the string. |
 |\\d,\\w,\\s|A digit, word character [A-Za-z0-9_], or whitespace. | |\\d,\\w,\\s|A digit, word character [A-Za-z0-9_], or whitespace. |
줄 9: 줄 10:
 |[abc]|Character a, b, or c. | |[abc]|Character a, b, or c. |
 |[a-z]|a through z. | |[a-z]|a through z. |
-|[^abc]|Any character except a, b, or c. |+|%%[^abc]%%|Any character except a, b, or c. |
 |%%aa|bb%%|Either aa or bb. | |%%aa|bb%%|Either aa or bb. |
 |?|Zero or one of the preceding element. | |?|Zero or one of the preceding element. |
줄 32: 줄 33:
   예 : aaa$ (문자열의 끝에 aaa를 포함하면 참, 그렇지 않으면 거짓)   예 : aaa$ (문자열의 끝에 aaa를 포함하면 참, 그렇지 않으면 거짓)
 =====문자표현===== =====문자표현=====
-(3) . (period) : 임의의 한 문자를 표시+(3) . (period) : 임의의 한 문자를 표시. 단 개행(New line) 제외
   예 : ^a.c (문자열의 처음에 abc, adc, aZc 등은 참, aa 는 거짓)   예 : ^a.c (문자열의 처음에 abc, adc, aZc 등은 참, aa 는 거짓)
       a..b$ (문자열의 끝에 aaab, abbb, azzb 등을 포함하면 참)       a..b$ (문자열의 끝에 aaab, abbb, azzb 등을 포함하면 참)
줄 188: 줄 189:
  
 출처: http://blog.bagesoft.com/178 출처: http://blog.bagesoft.com/178
-http://www.joinc.co.kr/modules/moniwiki/wiki.php/article/regex +
-{{tag>tech regex}}+