Skip to content

Commit 17f48b4

Browse files
translate until line 27
1 parent 1f1b759 commit 17f48b4

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

  • 9-regular-expressions/01-regexp-introduction

9-regular-expressions/01-regexp-introduction/article.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
# Patterns and flags
1+
# الگو ها و پرچم ها (Patterns and flags)
22

3-
Regular expressions are patterns that provide a powerful way to search and replace in text.
3+
عبارات باقاعده(Regular expressions) الگوهایی هستند که روشی قدرتمند برای جستجو و جایگزینی در متن ارائه می دهند.
44

5-
In JavaScript, they are available via the [RegExp](mdn:js/RegExp) object, as well as being integrated in methods of strings.
5+
در جاوا اسکریپت، آنها از طریق شیء [RegExp](mdn:js/RegExp) و همچنین به خوبی با متد های رشته ها ادغام می شوند.
66

7-
## Regular Expressions
7+
## عبارات باقاعده (Regular Expressions)
88

9-
A regular expression (also "regexp", or just "reg") consists of a *pattern* and optional *flags*.
9+
عبارت باقاعده (همچنین "regexp"، یا فقط "reg") از یک *الگو(pattern)* و *پرچم(flags)* های اختیاری تشکیل شده است.
1010

11-
There are two syntaxes that can be used to create a regular expression object.
11+
دو سینتکس وجود دارد که می توان از آنها برای ایجاد یک شیء عبارت باقاعده(Regular expression) استفاده کرد.
1212

13-
The "long" syntax:
13+
سینتکس "طولانی":
1414

1515
```js
16-
regexp = new RegExp("pattern", "flags");
16+
regexp = new RegExp("pattern(الگو)", "flags(پرچم)");
1717
```
1818

19-
And the "short" one, using slashes `"/"`:
19+
و سینتکس "کوتاه" نیز، استفاده از اسلش `"/"` می باشد.
2020

2121
```js
22-
regexp = /pattern/; // no flags
23-
regexp = /pattern/gmi; // with flags g,m and i (to be covered soon)
22+
regexp = /pattern/; // بدون پرچم
23+
regexp = /pattern/gmi; // با پرچم g, m, i (به زودی پوشش داده میشود)
2424
```
2525

26-
Slashes `pattern:/.../` tell JavaScript that we are creating a regular expression. They play the same role as quotes for strings.
26+
اسلش های `pattern:/.../` به جاوا اسکریپت می گوید که ما در حال ایجاد یک عبارت باقاعده هستیم. آنها همان نقش کوتیشن("") را برای رشته ها بازی می کنند.
2727

2828
In both cases `regexp` becomes an instance of the built-in `RegExp` class.
2929

0 commit comments

Comments
 (0)