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
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,9 +154,9 @@ alert( "We will, we will".replace(/we/ig, "I") ); // I will, I will
154
154
alert( "I love HTML".replace(/HTML/, "$& and JavaScript") ); // I love HTML and JavaScript
155
155
```
156
156
157
-
## Testing:regexp.test
157
+
## تست کردن:regexp.test
158
158
159
-
The method `regexp.test(str)`looks for at least one match, if found, returns`true`, otherwise `false`.
159
+
متد `regexp.test(str)`حداقل یک تطابق را جستجو میکند، در صورت یافتن`true`، در غیر این صورت `false` بر میگرداند.
160
160
161
161
```js run
162
162
let str = "I love JavaScript";
@@ -165,14 +165,14 @@ let regexp = /LOVE/i;
165
165
alert( regexp.test(str) ); // true
166
166
```
167
167
168
-
Later inthis chapter we'll study more regular expressions, walk through more examples, and also meet other methods.
168
+
بعداً در این فصل، عبارات باقاعده بیشتری را یاد می گیریم. مثالهای بیشتری را مرور می کنیم، و همچنین با روش های دیگر آشنا می شویم.
169
169
170
-
Full information about the methods is given in the article <info:regexp-methods>.
170
+
اطلاعات کامل در مورد متد ها در مقاله <info:regexp-methods> آورده شده است.
171
171
172
-
## Summary
172
+
## خلاصه
173
173
174
-
- A regular expression consists of a pattern and optional flags: `pattern:g`, `pattern:i`, `pattern:m`, `pattern:u`, `pattern:s`, `pattern:y`.
175
-
- Without flags and special symbols (that we'll study later), the search by a regexp is the same as a substring search.
176
-
-The method `str.match(regexp)`looks for matches: all of them if there's `pattern:g` flag, otherwise, only the first one.
177
-
- The method `str.replace(regexp, replacement)` replaces matches found using `regexp` with `replacement`: all of them if there's `pattern:g`flag, otherwise only the first one.
178
-
-The method `regexp.test(str)`returns `true`if there's at least one match, otherwise, it returns `false`.
174
+
-یک عبارت باقاعده از یک الگو و پرچمهای اختیاری تشکیل شده است:`pattern:g`،`pattern:i`،`pattern:m`،`pattern:u`،`pattern:s`،`pattern:y`.
175
+
-بدون پرچم و نمادهای خاص (که بعداً مطالعه خواهیم کرد)، جستجو توسط regexp مانند جستجوی زیر رشته(substring) است.
176
+
-متد `str.match(regexp)`به دنبال تطابق است: اگر پرچم `pattern:g`وجود داشته باشد، همه آنها را بر میگرداند، در غیر این صورت، فقط اولین مورد را بر میگرداند.
177
+
-متد `str.replace(regexp، replacement)»` تطابق های یافت شده با استفاده از `regexp`را با `replacement` جایگزین میکند: به همه آنها این فرایند را اعمال میکند اگر پرچم `pattern:g`وجود داشته باشد، در غیر این صورت فقط به اولین مورد اعمال میکند.
178
+
-متد `regexp.test(str)`اگر حداقل یک مورد مطابقت داشته باشد، `true` بر میگرداند، در غیر این صورت، `false` بر میگرداند.
0 commit comments