You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
111
111
112
-
A hex digit can be denoted as `pattern:\p{Hex_Digit}`:
112
+
یک رقم هگز را می توان به عنوان `pattern:\p{Hex_Digit}` نشان داد:
113
113
114
114
```js run
115
115
let regexp =/x\p{Hex_Digit}\p{Hex_Digit}/u;
116
116
117
117
alert("number: xAF".match(regexp)); // xAF
118
118
```
119
119
120
-
### Example: Chinese hieroglyphs
120
+
### مثال: هیروگلیف چینی
121
121
122
-
Let's look for Chinese hieroglyphs.
122
+
بیایید دنبال هیروگلیف چینی بگردیم.
123
+
یک ویژگی یونیکد `Script` (یک سیستم نوشتاری) وجود دارد که ممکن است دارای مقدار باشد: `سیریلیک`، `یونانی`، `عربی`، `هان` (چینی) و غیره، [فهرست کامل در اینجا آمده است](https://en.wikipedia.org/wiki/Script_(Unicode)).
123
124
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}` و غیره:
127
126
128
127
```js run
129
-
let regexp =/\p{sc=Han}/gu; //returns Chinese hieroglyphs
128
+
let regexp =/\p{sc=Han}/gu; //هیروگلیف های چینی را برمی گرداند
130
129
131
130
let str =`Hello Привет 你好 123_456`;
132
131
133
132
alert( str.match(regexp) ); // 你,好
134
133
```
135
134
136
-
### Example: currency
135
+
### مثال: ارز
137
136
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}`.
139
138
140
-
Let's use it to look for prices in the format "currency, followed by a digit":
139
+
بیایید از آن برای جستجوی قیمتها در قالب "ارز و به دنبال آن یک رقم" استفاده کنیم:
0 commit comments