aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/regexp
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/regexp')
-rw-r--r--files/ko/web/javascript/reference/global_objects/regexp/exec/index.html10
-rw-r--r--files/ko/web/javascript/reference/global_objects/regexp/index.html18
-rw-r--r--files/ko/web/javascript/reference/global_objects/regexp/regexp/index.html4
-rw-r--r--files/ko/web/javascript/reference/global_objects/regexp/test/index.html8
4 files changed, 20 insertions, 20 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/regexp/exec/index.html b/files/ko/web/javascript/reference/global_objects/regexp/exec/index.html
index d20573f473..eb02391603 100644
--- a/files/ko/web/javascript/reference/global_objects/regexp/exec/index.html
+++ b/files/ko/web/javascript/reference/global_objects/regexp/exec/index.html
@@ -26,7 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/exec
<h2 id="구문">구문</h2>
-<pre class="syntaxbox notranslate"><var>regexObj</var>.exec(<var>str</var>)</pre>
+<pre class="syntaxbox "><var>regexObj</var>.exec(<var>str</var>)</pre>
<h3 id="매개변수">매개변수</h3>
@@ -45,7 +45,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/exec
<p>다음과 같은 예제를 고려해보세요.</p>
-<pre class="brush: js notranslate">// Match "quick brown" followed by "jumps", ignoring characters in between
+<pre class="brush: js ">// Match "quick brown" followed by "jumps", ignoring characters in between
// Remember "brown" and "jumps"
// Ignore case
let re = /quick\s(brown).+?(jumps)/ig;
@@ -131,7 +131,7 @@ let result = re.exec('The Quick Brown Fox Jumps Over The Lazy Dog');</pre>
<p>If your regular expression uses the "<code>g</code>" flag, you can use the <code>exec()</code> method multiple times to find successive matches in the same string. When you do so, the search starts at the substring of <code>str</code> specified by the regular expression's {{jsxref("RegExp.lastIndex", "lastIndex")}} property ({{jsxref("RegExp.prototype.test()", "test()")}} will also advance the {{jsxref("RegExp.lastIndex", "lastIndex")}} property). For example, assume you have this script:</p>
-<pre class="brush: js notranslate">var myRe = /ab*/g;
+<pre class="brush: js ">var myRe = /ab*/g;
var str = 'abbcdefabh';
var myArray;
while ((myArray = myRe.exec(str)) !== null) {
@@ -143,7 +143,7 @@ while ((myArray = myRe.exec(str)) !== null) {
<p>This script displays the following text:</p>
-<pre class="notranslate">Found abb. Next match starts at 3
+<pre >Found abb. Next match starts at 3
Found ab. Next match starts at 9
</pre>
@@ -153,7 +153,7 @@ Found ab. Next match starts at 9
<p>You can also use <code>exec()</code> without creating a {{jsxref("RegExp")}} object:</p>
-<pre class="brush: js notranslate">var matches = /(hello \S+)/.exec('This is a hello world!');
+<pre class="brush: js ">var matches = /(hello \S+)/.exec('This is a hello world!');
console.log(matches[1]);
</pre>
diff --git a/files/ko/web/javascript/reference/global_objects/regexp/index.html b/files/ko/web/javascript/reference/global_objects/regexp/index.html
index 5675812788..166000e61a 100644
--- a/files/ko/web/javascript/reference/global_objects/regexp/index.html
+++ b/files/ko/web/javascript/reference/global_objects/regexp/index.html
@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/RegExp
<p>다음의 세 표현식은 모두 같은 정규 표현식을 생성합니다.</p>
-<pre class="brush: js notranslate">/ab+c/i
+<pre class="brush: js ">/ab+c/i
new RegExp(/ab+c/, 'i') // 리터럴
new RegExp('ab+c', 'i') // 생성자
</pre>
@@ -46,7 +46,7 @@ new RegExp('ab+c', 'i') // 생성자
<p>예를 들어 다음 두 줄은 동일한 정규 표현식을 생성합니다.</p>
-<pre class="brush: js notranslate">let re = /\w+/
+<pre class="brush: js ">let re = /\w+/
let re = new RegExp('\\w+')</pre>
<h3 id="Perl_형태의_RegExp_속성">Perl  형태의 <code>RegExp</code> 속성</h3>
@@ -121,7 +121,7 @@ let re = new RegExp('\\w+')</pre>
<p>대치 문자열에는 <code>$1</code>과 <code>$2</code>를 사용하여 정규 표현식 패턴의 각 괄호에 일치한 결과를 받아옵니다.</p>
-<pre class="brush: js notranslate">let re = /(\w+)\s(\w+)/
+<pre class="brush: js ">let re = /(\w+)\s(\w+)/
let str = 'John Smith'
let newstr = str.replace(re, '$2, $1')
console.log(newstr)</pre>
@@ -132,7 +132,7 @@ console.log(newstr)</pre>
<p>기본 줄 바꿈 문자는 플랫폼(Unix, Windows 등)마다 다릅니다. 아래의 분할 스크립트는 모든 플랫폼의 줄 바꿈을 인식합니다.</p>
-<pre class="brush: js notranslate">let text = 'Some text\nAnd some more\r\nAnd yet\rThis is the end'
+<pre class="brush: js ">let text = 'Some text\nAnd some more\r\nAnd yet\rThis is the end'
let lines = text.split(/\r\n|\r|\n/)
console.log(lines) // logs [ 'Some text', 'And some more', 'And yet', 'This is the end' ]</pre>
@@ -140,7 +140,7 @@ console.log(lines) // logs [ 'Some text', 'And some more', 'And yet', 'This is t
<h3 id="여러_줄에서_정규_표현식_사용하기">여러 줄에서 정규 표현식 사용하기</h3>
-<pre class="brush: js notranslate">let s = 'Please yes\nmake my day!'
+<pre class="brush: js ">let s = 'Please yes\nmake my day!'
s.match(/yes.*day/);
// Returns null
@@ -152,7 +152,7 @@ s.match(/yes[^]*day/);
<p>{{JSxRef("Global_Objects/RegExp/sticky", "sticky")}} 플래그는 해당 정규 표현식이 접착 판별, 즉 {{jsxref("RegExp.prototype.lastIndex")}}에서 시작하는 일치만 확인하도록 할 수 있습니다.</p>
-<pre class="brush: js notranslate">let str = '#foo#'
+<pre class="brush: js ">let str = '#foo#'
let regex = /foo/y
regex.lastIndex = 1
@@ -165,7 +165,7 @@ regex.lastIndex // 0 (reset after match failure)</pre>
<p>접착 플래그 <code>y</code>의 일치는 정확히 <code>lastIndex</code> 위치에서만 발생할 수 있으나, 전역 플래그 <code>g</code>의 경우 <code>lastIndex</code> 또는 그 이후에서도 발생할 수 있습니다.</p>
-<pre class="brush: js notranslate">re = /\d/y;
+<pre class="brush: js ">re = /\d/y;
while (r = re.exec("123 456")) console.log(r, "AND re.lastIndex", re.lastIndex);
// [ '1', index: 0, input: '123 456', groups: undefined ] AND re.lastIndex 1
@@ -181,7 +181,7 @@ while (r = re.exec("123 456")) console.log(r, "AND re.lastIndex", re.lastIndex);
<p>러시아어나 히브리어와 같은 다른 언어의 문자까지 일치하려면 <code>\uhhhh</code>(이때 hhhh는 해당 문자의 16진법 Unicode 값) 문법을 사용하세요. 아래 예제에서는 문자열에서 Unicode 문자를 추출합니다.</p>
-<pre class="brush: js notranslate">let text = 'Образец text на русском языке'
+<pre class="brush: js ">let text = 'Образец text на русском языке'
let regex = /[\u0400-\u04FF]+/g
let match = regex.exec(text)
@@ -198,7 +198,7 @@ console.log(regex.lastIndex) // logs '15'
<h3 id="URL에서_서브도메인_추출하기">URL에서 서브도메인 추출하기</h3>
-<pre class="brush: js notranslate">let url = 'http://xxx.domain.com'
+<pre class="brush: js ">let url = 'http://xxx.domain.com'
console.log(/[^.]+/.exec(url)[0].substr(7)) // logs 'xxx'</pre>
<div class="blockIndicator note">
diff --git a/files/ko/web/javascript/reference/global_objects/regexp/regexp/index.html b/files/ko/web/javascript/reference/global_objects/regexp/regexp/index.html
index 387b5bceff..a5ed17a62c 100644
--- a/files/ko/web/javascript/reference/global_objects/regexp/regexp/index.html
+++ b/files/ko/web/javascript/reference/global_objects/regexp/regexp/index.html
@@ -22,7 +22,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/RegExp
<p>리터럴, 생성자, 팩토리 표기법이 가능합니다.</p>
-<pre class="syntaxbox notranslate">/<var>pattern</var>/<var>flags</var>
+<pre class="syntaxbox ">/<var>pattern</var>/<var>flags</var>
new RegExp(<var>pattern</var>[, <var>flags</var>])
RegExp(<var>pattern</var>[, <var>flags</var>])
</pre>
@@ -73,7 +73,7 @@ RegExp(<var>pattern</var>[, <var>flags</var>])
<p>다음의 세 표현식은 모두 같은 정규 표현식을 생성합니다.</p>
-<pre class="brush: js notranslate">/ab+c/i
+<pre class="brush: js ">/ab+c/i
new RegExp(/ab+c/, 'i') // 리터럴
new RegExp('ab+c', 'i') // 생성자
</pre>
diff --git a/files/ko/web/javascript/reference/global_objects/regexp/test/index.html b/files/ko/web/javascript/reference/global_objects/regexp/test/index.html
index 07569e7eaf..8a4b200e5f 100644
--- a/files/ko/web/javascript/reference/global_objects/regexp/test/index.html
+++ b/files/ko/web/javascript/reference/global_objects/regexp/test/index.html
@@ -21,7 +21,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/test
<h2 id="구문">구문</h2>
-<pre class="syntaxbox notranslate"><var>regexObj</var>.test(<var>str</var>)</pre>
+<pre class="syntaxbox "><var>regexObj</var>.test(<var>str</var>)</pre>
<h3 id="매개변수">매개변수</h3>
@@ -48,7 +48,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/test
<p>문자열의 맨 처음에 <code>"hello"</code>가 포함됐는지 알아보는 간단한 예제 코드입니다.</p>
-<pre class="brush: js notranslate">const str = 'hello world!';
+<pre class="brush: js ">const str = 'hello world!';
const result = /^hello/.test(str);
console.log(result); // true
@@ -56,7 +56,7 @@ console.log(result); // true
<p>다음은 일치 여부에 따라 다른 메시지를 기록하는 예제입니다.</p>
-<pre class="brush: js notranslate">function testInput(re, str) {
+<pre class="brush: js ">function testInput(re, str) {
let midstring;
if (re.test(str)) {
midstring = 'contains';
@@ -81,7 +81,7 @@ console.log(result); // true
<p>이 행동에 대한 예제가 다음 코드입니다.</p>
-<pre class="brush: js notranslate">const regex = /foo/g; // the "global" flag is set
+<pre class="brush: js ">const regex = /foo/g; // the "global" flag is set
// regex.lastIndex is at 0
regex.test('foo') // true