일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- Let
- Append
- createtextnode
- boolean
- htmlFor
- const
- input
- VAR
- createElement
- Openlayers
- appendChild
- FOR
- 학습법 #집중력
- Today
- Total
Atomic Habits
vim 정규식(전방탐색 후방탐색) 본문
VIM 정규식
전방탐색/후방탐색
긍정형/부정형
(?=) : \(\)\@= : 긍전
(?<=) : \(\)\@<= : 긍후
(?!) : \(\)\@! : 부전
(?<!) : \(\)\@<! : 부후
3(?=천)
1000원, 3천원, 33원 >>> /3\(천\)\@= >>> 1000원, [3]천원, 33원
(?<=천)원
1000원, 3천원, 33원 >>> /\(천\)\@<=원 >>> 1000원, 3천[원], 33원
3(?!천)원
1000원, 3천원, 33원 >>> /3\(천\)\@!원 >>> 1000원, 3천원, 3[3원]
(?<!천)원
1000원, 3천원, 33원 >>> /\(천\)\@<!원 >>> 1000[원], 3천원, 33[원]
\(foo \)\@<=bar\( baz\)\@= matches the “bar” in foo bar baz.
But the lookaround groups are still required, so it doesn't match at all for foo bar qux or foo bar or foo.
(foo )@<=bar( baz)@= in very magic mode.
\(mi \)\@<=casa matches “casa” if preceded by “mi ”. So it matches only the first “casa” in mi casa es su casa.
\(mi \)\@<!casa matches “casa” if not preceded by “mi ”. So it matches only the second “casa” in mi casa es su casa.
dad\(\.\)\@= matches “dad” if followed by a period.
So it matches only the second “dad” in My dad is bigger than your dad.
dad\(\.\)\@= matches “dad” if not followed by a period.
So it matches only the first “dad” in My dad is bigger than your dad.
ex)
foo bar baz.
foo bar qux.
foo bar or foo.
mi casa es su casa.mi casa es su casa.
My dad is bigger than your dad.
My dad is bigger than your dad.
'IT > Regular Expressions' 카테고리의 다른 글
\b vs \B (0) | 2022.06.17 |
---|---|
정규식 - 긍정형/부정형 전방/후방 탐색 - 의미와 상세 예시 (0) | 2022.05.27 |
[정규식] 조건문 (0) | 2021.12.05 |
[정규식] 옵션 정리(광범위) (0) | 2021.12.05 |
[정규식] 그룹(group) 재참조 (0) | 2021.12.05 |