Skip to content

Commit 1c27504

Browse files
translate until line-146
1 parent 39e92e7 commit 1c27504

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

9-regular-expressions/03-regexp-unicode/article.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,37 +107,36 @@ alert( str.match(/\p{L}/g) ); // null (بدون منطبق، \p بدون پرچ
107107

108108
### مثال: اعداد هگزادسیمال
109109

110-
For instance, let's look for hexadecimal numbers, written as `xFF`, where `F` is a hex digit (0..9 or A..F).
110+
برای مثال، بیایید به دنبال اعداد هگزادسیمال بگردیم که به صورت `xFF` نوشته می‌شوند، جایی که `F` یک رقم هگزاست (0..9 یا A..F).
111111

112-
A hex digit can be denoted as `pattern:\p{Hex_Digit}`:
112+
یک رقم هگز را می توان به عنوان `pattern:\p{Hex_Digit}` نشان داد:
113113

114114
```js run
115115
let regexp = /x\p{Hex_Digit}\p{Hex_Digit}/u;
116116

117117
alert("number: xAF".match(regexp)); // xAF
118118
```
119119

120-
### Example: Chinese hieroglyphs
120+
### مثال: هیروگلیف چینی
121121

122-
Let's look for Chinese hieroglyphs.
122+
بیایید دنبال هیروگلیف چینی بگردیم.
123+
یک ویژگی یونیکد `Script` (یک سیستم نوشتاری) وجود دارد که ممکن است دارای مقدار باشد: `سیریلیک`، `یونانی`، `عربی`، `هان` (چینی) و غیره، [فهرست کامل در اینجا آمده است](https://en.wikipedia.org/wiki/Script_(Unicode)).
123124

124-
There's a Unicode property `Script` (a writing system), that may have a value: `Cyrillic`, `Greek`, `Arabic`, `Han` (Chinese) and so on, [here's the full list](https://en.wikipedia.org/wiki/Script_(Unicode)).
125-
126-
To look for characters in a given writing system we should use `pattern:Script=<value>`, e.g. for Cyrillic letters: `pattern:\p{sc=Cyrillic}`, for Chinese hieroglyphs: `pattern:\p{sc=Han}`, and so on:
125+
برای جستجوی کاراکترها در یک سیستم نوشتاری معین، باید از `<pattern:Script=<value` استفاده کنیم، به عنوان مثال. برای حروف سیریلیک: `pattern:\p{sc=Cyrillic}`، برای هیروگلیف چینی: `pattern:\p{sc=Han}` و غیره:
127126

128127
```js run
129-
let regexp = /\p{sc=Han}/gu; // returns Chinese hieroglyphs
128+
let regexp = /\p{sc=Han}/gu; // هیروگلیف های چینی را برمی گرداند
130129

131130
let str = `Hello Привет 你好 123_456`;
132131

133132
alert( str.match(regexp) ); // 你,好
134133
```
135134

136-
### Example: currency
135+
### مثال: ارز
137136

138-
Characters that denote a currency, such as `$`, ``, `¥`, have Unicode property `pattern:\p{Currency_Symbol}`, the short alias: `pattern:\p{Sc}`.
137+
کاراکتر ‌هایی که یک ارز را نشان می‌دهند، مانند `$`، ``، `¥`، دارای ویژگی یونیکد `pattern:\p{Currency_Symbol}` هستند، نام مستعار کوتاه: `pattern:\p{Sc}`.
139138

140-
Let's use it to look for prices in the format "currency, followed by a digit":
139+
بیایید از آن برای جستجوی قیمت‌ها در قالب "ارز و به دنبال آن یک رقم" استفاده کنیم:
141140

142141
```js run
143142
let regexp = /\p{Sc}\d/gu;

0 commit comments

Comments
 (0)