diff options
Diffstat (limited to 'files/zh-cn/web/javascript/guide/regular_expressions/character_classes/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/guide/regular_expressions/character_classes/index.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/files/zh-cn/web/javascript/guide/regular_expressions/character_classes/index.html b/files/zh-cn/web/javascript/guide/regular_expressions/character_classes/index.html index 26b1f4ee4a..80f9181f89 100644 --- a/files/zh-cn/web/javascript/guide/regular_expressions/character_classes/index.html +++ b/files/zh-cn/web/javascript/guide/regular_expressions/character_classes/index.html @@ -144,7 +144,7 @@ translation_of: Web/JavaScript/Guide/Regular_Expressions/Character_Classes <h3 id="Looking_for_a_series_of_digits">Looking for a series of digits</h3> -<pre class="brush: js notranslate">var randomData = "015 354 8787 687351 3512 8735"; +<pre class="brush: js">var randomData = "015 354 8787 687351 3512 8735"; var regexpFourDigits = /\b\d{4}\b/g; // \b indicates a boundary (i.e. do not start matching in the middle of a word) // \d{4} indicates a digit, four times @@ -157,7 +157,7 @@ console.table(randomData.match(regexpFourDigits)); <h3 id="Looking_for_a_word_from_the_latin_alphabet_starting_with_A">Looking for a word (from the latin alphabet) starting with A</h3> -<pre class="brush: js notranslate">var aliceExcerpt = "I’m sure I’m not Ada,’ she said, ‘for her hair goes in such long ringlets, and mine doesn’t go in ringlets at all."; +<pre class="brush: js">var aliceExcerpt = "I’m sure I’m not Ada,’ she said, ‘for her hair goes in such long ringlets, and mine doesn’t go in ringlets at all."; var regexpWordStartingWithA = /\b[aA]\w+/g; // \b indicates a boundary (i.e. do not start matching in the middle of a word) // [aA] indicates the letter a or A @@ -171,7 +171,7 @@ console.table(aliceExcerpt.match(regexpWordStartingWithA)); <p>Instead of the Latin alphabet, we can use a range of Unicode characters to identify a word (thus being able to deal with text in other languages like Russian or Arabic). The "Basic Multilingual Plane" of Unicode contains most of the characters used around the world and we can use character classes and ranges to match words written with those characters.</p> -<pre class="brush: js notranslate">var nonEnglishText = "Приключения Алисы в Стране чудес"; +<pre class="brush: js">var nonEnglishText = "Приключения Алисы в Стране чудес"; var regexpBMPWord = /([\u0000-\u0019\u0021-\uFFFF])+/gu; // BMP goes through U+0000 to U+FFFF but space is U+0020 |