[과제번역] Part9. 9.10 과제 번역 (#1672) by crud0626 · Pull Request #1673 · javascript-tutorial/ko.javascript.info · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A match for /d+? d+?/
# /d+? d+?/와 일치하는 것은 무엇일까요?

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

```js
"123 456".match(/\d+? \d+?/g); // ?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
We need to find the beginning of the comment `match:<!--`, then everything till the end of `match:-->`.
주석의 시작 `match:<!--`부터, `match:-->`로 끝나는 모든 것을 찾아야 합니다.

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.
게으른 수량자(가능한 한 적게 찾는 - 옮긴이)는 점이 `match:-->`직전에 멈추게 하므로 허용할 수 있는 변형은 `pattern:<!--.*?-->`입니다. 또한, 점이 줄 바꿈을 포함할 수 있도록 `pattern:s`플래그를 추가합니다.

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

```js run
let regexp = /<!--.*?-->/gs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find HTML comments
# HTML 주석들을 찾아보세요.

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

```js
let regexp = /your regexp/g;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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

```js run
let regexp = /<[^<>]+>/g;
Expand Down