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
Copy file name to clipboardExpand all lines: 9-regular-expressions/01-regexp-introduction/article.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,21 +69,21 @@ let regexp = new RegExp(`<${tag}>`); // مانند /<h2>/ اگر در اعلان
69
69
- result -- `match:green`
70
70
```
71
71
72
-
## Searching: str.match
72
+
## جستجو: str.match
73
73
74
-
As mentioned previously, regular expressions are integrated with string methods.
74
+
همانطور که قبلا ذکر شد، عبارات باقاعده با متدهای رشته ای ادغام می شوند.
75
75
76
-
The method `str.match(regexp)`finds all matches of `regexp`in the string`str`.
76
+
متد `str.match(regexp)`همه مطابقت های `regexp`را در رشته`str` پیدا میکند.
77
77
78
-
It has 3 working modes:
78
+
و دارای 3 حالت کار است:
79
79
80
-
1.If the regular expression has flag `pattern:g`, it returns an array of all matches:
80
+
1.اگر عبارت باقاعده دارای پرچم `pattern:g` باشد، آرایهای از همه موارد مطابق را بر می گرداند:
81
81
```js run
82
82
let str ="We will, we will rock you";
83
83
84
-
alert( str.match(/we/gi) ); // We,we (an array of 2 substrings that match)
84
+
alert( str.match(/we/gi) ); // We,we (آرایه ای از 2 رشته که مطابقت دارند)
85
85
```
86
-
Please note that both`match:We`and`match:we`are found, because flag `pattern:i`makes the regular expression case-insensitive.
86
+
لطفاً توجه کنید که`match:We`و`match:we`نتیجه یکسانی میدهند، زیرا پرچم `pattern:i`باعث میشود که عبارت باقاعده به حروف بزرگ و کوچک حساس نباشد.
87
87
88
88
2. If there's no such flag it returns only the first match in the form of an array, with the full match at index `0` and some additional details in properties:
0 commit comments