This site uses cookies.
Some of these cookies are essential to the operation of the site,
while others help to improve your experience by providing insights into how the site is being used.
For more information, please see the ProZ.com privacy policy.
This person has a SecurePRO™ card. Because this person is not a ProZ.com Plus subscriber, to view his or her SecurePRO™ card you must be a ProZ.com Business member or Plus subscriber.
Affiliations
This person is not affiliated with any business or Blue Board record at ProZ.com.
English to Korean: Regular Expressions - Quantifiers (Markdown Format) General field: Tech/Engineering Detailed field: IT (Information Technology)
Source text - English # Quantifiers +, *, ? and {n}
Let's say we have a string like `+7(903)-123-45-67` and want to find all numbers in it. But unlike before, we are interested not in single digits, but full numbers: `7, 903, 123, 45, 67`.
A number is a sequence of 1 or more digits `pattern:\d`. To mark how many we need, we can append a *quantifier*.
## Quantity {n}
The simplest quantifier is a number in curly braces: `pattern:{n}`.
A quantifier is appended to a character (or a character class, or a `[...]` set etc) and specifies how many we need.
It has a few advanced forms, let's see examples:
The exact count: `pattern:{5}`
: `pattern:\d{5}` denotes exactly 5 digits, the same as `pattern:\d\d\d\d\d`.
The example below looks for a 5-digit number:
```js run
alert( "I'm 12345 years old".match(/\d{5}/) ); // "12345"
```
We can add `\b` to exclude longer numbers: `pattern:\b\d{5}\b`.
Translation - Korean # 수량자 +, *, ?, {n}
문자열 `+7(903)-123-45-67`에서 모든 숫자를 찾고 싶다고 가정해봅시다. 전처럼 한 자리짜리 숫자를 찾던 것과는 달리, `7, 903, 123, 45, 67`처럼 수 전부를 가져오려 합니다.
찾으려는 수는 `pattern:\d`가 한 개 이상 나열된(즉, 한 자릿수 이상인) 형태입니다. 표현식의 일치 횟수 지정을 위해 *수량자*를 사용할 수 있습니다.
## 수량 {n}
`pattern:{n}`은 숫자를 중괄호로 감싼 매우 간결한 형태의 수량자입니다.
문자(또는 문자 클래스나 `[...]` 문자 집합 등) 뒤에 덧붙여 몇 개를 찾고 싶은지를 표현합니다.
이 수량자는 몇 가지 고급 사용 형식을 지원합니다. 예시를 살펴봅시다.
정확한 수 일치: `pattern:{5}`
: `pattern:\d{5}`는 정확히 다섯 자리의 수를 나타내며, `pattern:\d\d\d\d\d`와 같은 의미를 가집니다.
다음은 다섯 자리 숫자를 찾는 예시입니다.
```js run
alert( "저는 12345살입니다.".match(/\d{5}/) ); // "12345"
```
다섯 자리보다 자릿수가 더 큰 수를 찾는 것을 방지하기 위해 다음과 같이 `\b`를 덧붙일 수 있습니다. `pattern:\b\d{5}\b`
Adobe Acrobat, Adobe Illustrator, Adobe Photoshop, MateCat, Microsoft Excel, Microsoft Office Pro, Microsoft Word, Powerpoint, SDLX, Smartcat, Smartling, Trados Online Editor, Trados Studio