Skip to content

Commit b687852

Browse files
finish artilce
1 parent 67e6072 commit b687852

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

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

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ alert( "We will, we will".replace(/we/ig, "I") ); // I will, I will
154154
alert( "I love HTML".replace(/HTML/, "$& and JavaScript") ); // I love HTML and JavaScript
155155
```
156156

157-
## Testing: regexp.test
157+
## تست کردن: regexp.test
158158

159-
The method `regexp.test(str)` looks for at least one match, if found, returns `true`, otherwise `false`.
159+
متد `regexp.test(str)` حداقل یک تطابق را جستجو می‌کند، در صورت یافتن `true`، در غیر این صورت `false` بر میگرداند.
160160

161161
```js run
162162
let str = "I love JavaScript";
@@ -165,14 +165,14 @@ let regexp = /LOVE/i;
165165
alert( regexp.test(str) ); // true
166166
```
167167

168-
Later in this chapter we'll study more regular expressions, walk through more examples, and also meet other methods.
168+
بعداً در این فصل، عبارات باقاعده بیشتری را یاد می گیریم. مثال‌های بیشتری را مرور می‌ کنیم، و همچنین با روش‌ های دیگر آشنا می‌ شویم.
169169

170-
Full information about the methods is given in the article <info:regexp-methods>.
170+
اطلاعات کامل در مورد متد ها در مقاله <info:regexp-methods> آورده شده است.
171171

172-
## Summary
172+
## خلاصه
173173

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

Comments
 (0)