Skip to content

Commit 6d44da5

Browse files
translate search no.1
1 parent ffac614 commit 6d44da5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ let regexp = new RegExp(`<${tag}>`); // مانند /<h2>/ اگر در اعلان
6969
- result -- `match:green`
7070
```
7171

72-
## Searching: str.match
72+
## جستجو: str.match
7373

74-
As mentioned previously, regular expressions are integrated with string methods.
74+
همانطور که قبلا ذکر شد، عبارات باقاعده با متدهای رشته ای ادغام می شوند.
7575

76-
The method `str.match(regexp)` finds all matches of `regexp` in the string `str`.
76+
متد `str.match(regexp)` همه مطابقت‌ های `regexp` را در رشته `str` پیدا می‌کند.
7777

78-
It has 3 working modes:
78+
و دارای 3 حالت کار است:
7979

80-
1. If the regular expression has flag `pattern:g`, it returns an array of all matches:
80+
1. اگر عبارت باقاعده دارای پرچم `pattern:g` باشد، آرایه‌ای از همه موارد مطابق را بر می‌ گرداند:
8181
```js run
8282
let str = "We will, we will rock you";
8383

84-
alert( str.match(/we/gi) ); // We,we (an array of 2 substrings that match)
84+
alert( str.match(/we/gi) ); // We,we (آرایه ای از 2 رشته که مطابقت دارند)
8585
```
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` باعث می‌شود که عبارت باقاعده به حروف بزرگ و کوچک حساس نباشد.
8787

8888
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:
8989
```js run

0 commit comments

Comments
 (0)