Skip to content

Commit 4ef31fd

Browse files
committed
[과제번역] Part9. 9.10 과제 번역 (javascript-tutorial#1672)
1 parent 8aa81f7 commit 4ef31fd

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
The result is: `match:123 4`.
2+
정답: `match:123 4`
33

4-
First the lazy `pattern:\d+?` tries to take as little digits as it can, but it has to reach the space, so it takes `match:123`.
4+
첫 번째 `pattern:\d+?` 는 가능한 적은 숫자를 가지려고 하지만 공백에 닿게 되어 `match:123`을 가집니다.
55

6-
Then the second `\d+?` takes only one digit, because that's enough.
6+
두 번째 `\d+?`는 조건을 만족했기 때문에 한 개의 숫자만 가지게 됩니다.

9-regular-expressions/10-regexp-greedy-and-lazy/1-lazy-greedy/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# A match for /d+? d+?/
1+
# /d+? d+?/와 일치하는 것은 무엇일까요?
22

3-
What's the match here?
3+
여기서 어떤 것들이 일치할까요?
44

55
```js
66
"123 456".match(/\d+? \d+?/g); // ?

9-regular-expressions/10-regexp-greedy-and-lazy/3-find-html-comments/solution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
We need to find the beginning of the comment `match:<!--`, then everything till the end of `match:-->`.
1+
주석의 시작 `match:<!--`부터, `match:-->`로 끝나는 모든 것을 찾아야 합니다.
22

3-
An acceptable variant is `pattern:<!--.*?-->` -- the lazy quantifier makes the dot stop right before `match:-->`. We also need to add flag `pattern:s` for the dot to include newlines.
3+
게으른 수량자(가능한 한 적게 찾는 - 옮긴이)는 점이 `match:-->`직전에 멈추게 하므로 허용할 수 있는 변형은 `pattern:<!--.*?-->`입니다. 또한, 점이 줄 바꿈을 포함할 수 있도록 `pattern:s`플래그를 추가합니다.
44

5-
Otherwise multiline comments won't be found:
5+
그렇지 않으면, 여러 줄로 구성된 주석들을 찾을 수 없습니다.
66

77
```js run
88
let regexp = /<!--.*?-->/gs;

9-regular-expressions/10-regexp-greedy-and-lazy/3-find-html-comments/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Find HTML comments
1+
# HTML 주석들을 찾아보세요.
22

3-
Find all HTML comments in the text:
3+
문자열에서 모든 HTML 주석들을 찾아보세요.
44

55
```js
66
let regexp = /your regexp/g;

9-regular-expressions/10-regexp-greedy-and-lazy/4-find-html-tags-greedy-lazy/solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
The solution is `pattern:<[^<>]+>`.
2+
정답은 `pattern:<[^<>]+>`입니다.
33

44
```js run
55
let regexp = /<[^<>]+>/g;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Find HTML tags
1+
# HTML 태그들을 찾아 보세요
22

3-
Create a regular expression to find all (opening and closing) HTML tags with their attributes.
3+
HTML의 프로퍼티를 포함한 모든 태그(열리고 닫히는)를 찾기 위한 정규표현식을 작성하세요.
44

5-
An example of use:
5+
예제:
66

77
```js run
88
let regexp = /your regexp/g;
@@ -12,4 +12,4 @@ let str = '<> <a href="/"> <input type="radio" checked> <b>';
1212
alert( str.match(regexp) ); // '<a href="/">', '<input type="radio" checked>', '<b>'
1313
```
1414

15-
Here we assume that tag attributes may not contain `<` and `>` (inside squotes too), that simplifies things a bit.
15+
단순화하기 위해 태그의 프로퍼티들은 `<``>`을 포함하지 않는다고 가정합니다. (프로퍼티의 값 내부에서도)

0 commit comments

Comments
 (0)