From 9ed1a20b215c7621b54018c1e4e589dc35980805 Mon Sep 17 00:00:00 2001 From: "yeongjun.kim" Date: Fri, 16 Mar 2018 15:30:41 +0900 Subject: [PATCH] Translate 'Greedy vs lazy matching' into korean --- README-ko.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README-ko.md b/README-ko.md index e3029d0..413c5a0 100644 --- a/README-ko.md +++ b/README-ko.md @@ -59,6 +59,7 @@ - [대소문자 구분없음](#51-대소문자-구분없음) - [전체 검색](#52-전체-검색) - [멀티 라인](#53-멀티-라인) + - [탐욕적 vs 게으른 매칭](#6-탐욕적-vs-게으른 매칭) ## 1. 기본 매쳐 @@ -401,6 +402,22 @@ [Test the regular expression](https://regex101.com/r/E88WE2/1) +## 6. 탐욕적 vs 게으른 매칭 +기본적으로 정규 표현식은 탐욕적(greedy) 매칭을 수행하는데, 이는 가능한 한 길게 매칭하는 것을 의미한다. +우리는 `?`를 사용하여 게으른(lazy) 방법 매칭할 수 있으며, 가능한 한 짧게 매칭하는 것을 의미한다. + +
+"/(.*at)/" => The fat cat sat on the mat. 
+
+ +[Test the regular expression](https://regex101.com/r/AyAdgJ/1) + +
+"/(.*?at)/" => The fat cat sat on the mat. 
+
+ +[Test the regular expression](https://regex101.com/r/AyAdgJ/2) + ## 기여 방법 * 이슈 리포팅