Skip to content

[신규 번역] Part 3.9.7 regexp-escaping 번역 #1200 #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update article.md
  • Loading branch information
dntjr970 authored Nov 27, 2021
commit 4acfe7915d59cb470c85167730aab4113e43f9cb
12 changes: 6 additions & 6 deletions 9-regular-expressions/07-regexp-escaping/article.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# 이스케이프, 특수 문자

본 바와 같이 백슬래쉬 `pattern:\`는 문자 클래스(예:`pattern:\d`)를 나타내는데 사용됩니다. 따라서 이는 정규 표현식의 특수문자 입니다. (일반 문자열도 해당).
본 바와 같이 백슬래시 `pattern:\`는 문자 클래스(예:`pattern:\d`)를 나타내는데 사용됩니다. 따라서 이는 정규 표현식의 특수문자 입니다. (일반 문자열도 해당).

정규 표현식에서 특별한 의미를 가지는 다른 특수 문자도 있습니다. 이는 보다 강력한 검색에 사용됩니다. 다음은 전체 리스트`pattern:[ \ ^ $ . | ? * + ( )` 입니다.

Expand All @@ -11,9 +11,9 @@

문자 그대로 '.'을 찾는다고 해봅시다. 모든 글자가 아니라 진짜 점을 찾습니다.

특수 문자를 일반 문자로 사용하려면, 점 앞에 백슬래쉬`pattern:\.`를 붙입니다.
특수 문자를 일반 문자로 사용하려면, 점 앞에 백슬래시`pattern:\.`를 붙입니다.

"탈출문자"이라고도 합니다.
"탈출문자"라고도 합니다.

예시:
```js run
Expand All @@ -27,15 +27,15 @@ alert( "Chapter 511".match(/\d\.\d/) ); // null (진짜 점\.를 찾고 있습
alert( "function g()".match(/g\(\)/) ); // "g()"
```

If we're looking for a backslash `\`, it's a special character in both regular strings and regexps, so we should double it.
백슬래시 `\`를 찾고 있다면 일반 문자열과 정규 표현식에서 모두 특수 문자이기 때문에 두 번 작성해야 합니다.

```js run
alert( "1\\2".match(/\\/) ); // '\'
```

## A slash
## 슬래시

A slash symbol `'/'` is not a special character, but in JavaScript it is used to open and close the regexp: `pattern:/...pattern.../`, so we should escape it too.
`'/'` is not a special character, but in JavaScript it is used to open and close the regexp: `pattern:/...pattern.../`, so we should escape it too.

Here's what a search for a slash `'/'` looks like:

Expand Down