Skip to content

Commit 78d91e3

Browse files
committed
wip quantifiers 1
1 parent 10910e1 commit 78d91e3

File tree

1 file changed

+17
-17
lines changed
  • 9-regular-expressions/09-regexp-quantifiers

1 file changed

+17
-17
lines changed

9-regular-expressions/09-regexp-quantifiers/article.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
# Quantifiers +, *, ? and {n}
1+
# কোয়ান্টিফায়ার +, *, ? এবং {n}
22

3-
Let's say we have a string like `+7(903)-123-45-67` and want to find all numbers in it. But unlike before, we are interested not in single digits, but full numbers: `7, 903, 123, 45, 67`.
3+
এখন মনে করন আমাদের এমন একটি `+7(903)-123-45-67` স্ট্রিং আছে এবং আমরা এর সকল নাম্বার খুঁজে পেতে চাই। কিন্ত পূর্বের মত, আমরা একক অঙ্ক চাই না, পূর্ণ সংখ্যা চাই: `7, 903, 123, 45, 67`
44

5-
A number is a sequence of 1 or more digits `pattern:\d`. To mark how many we need, we can append a *quantifier*.
5+
সংখ্যা হল এক বা একাধিক অঙ্কের একটি সমষ্টি `pattern:\d`. আমাদের প্রয়োজনমত অঙ্কের জন্য আমরা *quantifier* সংযোজন করতে পারি।
66

7-
## Quantity {n}
7+
## সংখ্যা {n}
88

9-
The simplest quantifier is a number in curly braces: `pattern:{n}`.
9+
সবচেয়ে সহজ কোয়ান্টিফায়ার হল দ্বিতীয় বন্ধনীর মধ্যে একটি সংখ্যা: `pattern:{n}`
1010

11-
A quantifier is appended to a character (or a character class, or a `[...]` set etc) and specifies how many we need.
11+
কোয়ান্টিফায়ারে যেকোন ধরণের ক্যারাক্টার (অথবা ক্যারাক্টার ক্লাস, অথবা `[...]` সেট ইত্যাদি) আমাদের প্রয়োজনমত সংযোজন করতে পারি।
1212

13-
It has a few advanced forms, let's see examples:
13+
এটি ব্যবহারের বিভিন্ন উপায় আছে, চলুন কয়েকটি উদাহরণ দেখি:
1414

15-
The exact count: `pattern:{5}`
16-
: `pattern:\d{5}` denotes exactly 5 digits, the same as `pattern:\d\d\d\d\d`.
15+
নির্দিষ্ট সংখ্যা গণনা: `pattern:{5}`
16+
: `pattern:\d{5}` এটি দ্বারা ৫টি অঙ্ক বুঝায়, যা `pattern:\d\d\d\d\d` এর অনুরূপ।
1717

18-
The example below looks for a 5-digit number:
18+
নিচের উদাহরণে একটি ৫ অঙ্কের সংখ্যা খুঁজা হচ্ছে:
1919

2020
```js run
2121
alert( "I'm 12345 years old".match(/\d{5}/) ); // "12345"
2222
```
2323

24-
We can add `\b` to exclude longer numbers: `pattern:\b\d{5}\b`.
24+
আমরা `\b` যুক্ত করে এর চেয়ে বড় সংখ্যাগুলো বাদ দিতে পারি: `pattern:\b\d{5}\b`
2525

26-
The range: `pattern:{3,5}`, match 3-5 times
27-
: To find numbers from 3 to 5 digits we can put the limits into curly braces: `pattern:\d{3,5}`
26+
রেঞ্জ: `pattern:{3,5}`, ৩-৫ অঙ্কের সংখ্যার সাথে মিল খুঁজে
27+
: ৩ থেকে ৫ অঙ্কের মধ্যের সংখ্যা গুলো খুঁজতে আমরা দ্বিতীয় বন্ধনীতে সীমা নির্ধারণ করে দিতে পারি: `pattern:\d{3,5}`
2828

2929
```js run
3030
alert( "I'm not 12, but 1234 years old".match(/\d{3,5}/) ); // "1234"
3131
```
3232

33-
We can omit the upper limit.
33+
আমরা সর্বোচ্চ সীমাটি বাদ দিতে পারি।
3434

35-
Then a regexp `pattern:\d{3,}` looks for sequences of digits of length `3` or more:
35+
এ রেগুলার এক্সপ্রেশনটি `pattern:\d{3,}` ৩ বা ততোধিক অঙ্কের মিল গুলো খুঁজে:
3636

3737
```js run
3838
alert( "I'm not 12, but 345678 years old".match(/\d{3,}/) ); // "345678"
3939
```
4040

41-
Let's return to the string `+7(903)-123-45-67`.
41+
এখন আমাদের পূর্বের `+7(903)-123-45-67` স্ট্রিংটি দেখি।
4242

43-
A number is a sequence of one or more digits in a row. So the regexp is `pattern:\d{1,}`:
43+
সংখ্যা হল এক বা একাধিক অঙ্কের সমষ্টি। সুতরাং রেগুলার এক্সপ্রেশনটি হবে `pattern:\d{1,}`:
4444

4545
```js run
4646
let str = "+7(903)-123-45-67";

0 commit comments

Comments
 (0)