diff --git a/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md b/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md index 26f7888f7..e9a28b66c 100644 --- a/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md +++ b/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md @@ -1,21 +1,21 @@ -A two-digit hex number is `pattern:[0-9a-f]{2}` (assuming the flag `pattern:i` is set). +একটি দুই অঙ্কবিশিষ্ট হেক্সাডেসিমেল নাম্বারের প্যাটার্ন হল `pattern:[0-9a-f]{2}` (ধরে নিই, `pattern:i` ফ্ল্যাগ সেট আছে)। -We need that number `NN`, and then `:NN` repeated 5 times (more numbers); +সুতরাং আমাদের এই নাম্বারটি `NN` লাগবে, এবং এটির `:NN` ৫ বার পুনরাবৃত্তি হবে; -The regexp is: `pattern:[0-9a-f]{2}(:[0-9a-f]{2}){5}` +সুতরাং রেগুলার এক্সপ্রেশনটি হবে: `pattern:[0-9a-f]{2}(:[0-9a-f]{2}){5}` -Now let's show that the match should capture all the text: start at the beginning and end at the end. That's done by wrapping the pattern in `pattern:^...$`. +এখন চলুন ম্যাচটি শুরু থেকে শেষ পর্যন্ত সকল পুরো লাইনটি পাঠ করার উপযোগী করি। এজন্য সম্পূর্ন প্যাটার্নটি `pattern:^...$` এর মধ্যে লিখি। -Finally: +শেষ পর্যন্ত: ```js run let regexp = /^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/i; -alert( regexp.test('01:32:54:67:89:AB') ); // true +alert( regexp.test('01:32:54:67:89:AB') ); // সত্য -alert( regexp.test('0132546789AB') ); // false (no colons) +alert( regexp.test('0132546789AB') ); // মিথ্যা (কোলন নেয়) -alert( regexp.test('01:32:54:67:89') ); // false (5 numbers, need 6) +alert( regexp.test('01:32:54:67:89') ); // মিথ্যা (৫টি নাম্বার, অবশ্যই ৬টি হতে হবে) -alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ in the end) +alert( regexp.test('01:32:54:67:89:ZZ') ) // মিথ্যা (শেষে ZZ) ``` diff --git a/9-regular-expressions/11-regexp-groups/01-test-mac/task.md b/9-regular-expressions/11-regexp-groups/01-test-mac/task.md index 029a4803a..b36bf69f3 100644 --- a/9-regular-expressions/11-regexp-groups/01-test-mac/task.md +++ b/9-regular-expressions/11-regexp-groups/01-test-mac/task.md @@ -1,20 +1,20 @@ -# Check MAC-address +# MAC-address যাচাই -[MAC-address](https://en.wikipedia.org/wiki/MAC_address) of a network interface consists of 6 two-digit hex numbers separated by a colon. +[MAC-address](https://en.wikipedia.org/wiki/MAC_address) হল নেটওয়ার্ক ইন্টারফেসের ৬ টি দুই অঙ্কবিশিষ্ট একটি হেক্সাডেসিমেল নাম্বার যা কোলন দ্বারা পৃথক থাকে। -For instance: `subject:'01:32:54:67:89:AB'`. +যেমন: `subject:'01:32:54:67:89:AB'`। -Write a regexp that checks whether a string is MAC-address. +MAC-address যাচাইয়ের জন্য একটি রেগুলার এক্সপ্রেশন লিখুন। -Usage: +উদাহরণস্বরুপ: ```js -let regexp = /your regexp/; +let regexp = /আপনার প্যাটার্ন লিখুন/; -alert( regexp.test('01:32:54:67:89:AB') ); // true +alert( regexp.test('01:32:54:67:89:AB') ); // সত্য -alert( regexp.test('0132546789AB') ); // false (no colons) +alert( regexp.test('0132546789AB') ); // মিথ্যা (কোলন নেয়) -alert( regexp.test('01:32:54:67:89') ); // false (5 numbers, must be 6) +alert( regexp.test('01:32:54:67:89') ); // মিথ্যা (৫টি নাম্বার, অবশ্যই ৬টি হতে হবে) -alert( regexp.test('01:32:54:67:89:ZZ') ) // false (ZZ ad the end) +alert( regexp.test('01:32:54:67:89:ZZ') ) // মিথ্যা (শেষে ZZ) ``` diff --git a/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/solution.md b/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/solution.md index 0806dc4fd..8aea4299e 100644 --- a/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/solution.md +++ b/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/solution.md @@ -1,12 +1,12 @@ -A regexp to search 3-digit color `#abc`: `pattern:/#[a-f0-9]{3}/i`. +৩ অঙ্কবিশিষ্ট সংখ্যা খুঁজার রেগুলার এক্সপ্রেশন হল `#abc`: `pattern:/#[a-f0-9]{3}/i`। -We can add exactly 3 more optional hex digits. We don't need more or less. The color has either 3 or 6 digits. +এরপর আমরা শুধুমাত্র আরো ৩অঙ্কবিশিষ্ট অপশনাল হেক্সাডেসিমেল নাম্বার খুঁজার প্যাটার্ন লিখব, আমাদের এর বেশি বা কমের জন্য লাগবে না। সুতরাং কালারটি হবে ৩ বা ৬ অঙ্কের। -Let's use the quantifier `pattern:{1,2}` for that: we'll have `pattern:/#([a-f0-9]{3}){1,2}/i`. +চলুন এই জন্য এই কোয়ান্টিফায়ারটি `pattern:{1,2}` ব্যবহার করি: আমাদের প্যাটার্নটি হবে `pattern:/#([a-f0-9]{3}){1,2}/i`। -Here the pattern `pattern:[a-f0-9]{3}` is enclosed in parentheses to apply the quantifier `pattern:{1,2}`. +এখানে আমরা এই প্যাটার্নটি `pattern:[a-f0-9]{3}` প্যারান্টেসিসের মধ্যে লিখব, যাতে এই কোয়ান্টিফায়ারটি `pattern:{1,2}` ব্যবহার করা যায়। -In action: +এখানে দেখুন: ```js run let regexp = /#([a-f0-9]{3}){1,2}/gi; @@ -16,7 +16,7 @@ let str = "color: #3f3; background-color: #AA00ef; and: #abcd"; alert( str.match(regexp) ); // #3f3 #AA00ef #abc ``` -There's a minor problem here: the pattern found `match:#abc` in `subject:#abcd`. To prevent that we can add `pattern:\b` to the end: +তবে এখানে একটি ছোট্ট সমস্যা আছে `match:#abc` এই স্ট্রিংয়ের জন্যও কাজ করবে `subject:#abcd`, যা সঠিক নয়। এজন্য আমাদের শেষে `pattern:\b` ব্যবহার করা লাগবে: ```js run let regexp = /#([a-f0-9]{3}){1,2}\b/gi; diff --git a/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/task.md b/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/task.md index 09108484a..7203ea33a 100644 --- a/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/task.md +++ b/9-regular-expressions/11-regexp-groups/02-find-webcolor-3-or-6/task.md @@ -1,14 +1,14 @@ -# Find color in the format #abc or #abcdef +# এই কালার ফরম্যাটগুলো খুঁজুন #abc বা #abcdef -Write a RegExp that matches colors in the format `#abc` or `#abcdef`. That is: `#` followed by 3 or 6 hexadecimal digits. +একটি রেগুলার এক্সপ্রেশন লিখুন যা এই দুটি কালার ফরম্যাটের সাথে ম্যাচ করবে `#abc` বা `#abcdef`। এটি হবে: `#` দ্বারা ৩ বা ৬ অঙ্কের হেক্সাডেসিমেল নাম্বার। -Usage example: +উদাহরণস্বরুপ: ```js -let regexp = /your regexp/g; +let regexp = /আপনার প্যাটার্ন লিখুন/g; let str = "color: #3f3; background-color: #AA00ef; and: #abcd"; alert( str.match(regexp) ); // #3f3 #AA00ef ``` -P.S. This should be exactly 3 or 6 hex digits. Values with 4 digits, such as `#abcd`, should not match. +বি.দ্র. এটি অবশ্যই ৩ বা ৬ অঙ্কের হেক্সাডেসিমেল নাম্বার হতে হবে। যেমন, ৪ অঙ্কের সাথে `#abcd` এরা মিলবে না। \ No newline at end of file diff --git a/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/solution.md b/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/solution.md index c4349f9a0..85254c216 100644 --- a/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/solution.md +++ b/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/solution.md @@ -1,6 +1,6 @@ -A positive number with an optional decimal part is (per previous task): `pattern:\d+(\.\d+)?`. +আমরা পূর্বের চ্যাপ্টারে ডেসিমেল সংখ্যা কে অপশনাল রেখে খুঁজার উপায় দেখেছিলাম: `pattern:\d+(\.\d+)?`। -Let's add the optional `pattern:-` in the beginning: +ঋণাত্নক সংখ্যা খুঁজার জন্য শুরুতে `pattern:-` কে অপশনাল হিসেবে যোগ করি: ```js run let regexp = /-?\d+(\.\d+)?/g; diff --git a/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/task.md b/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/task.md index 4f5a73fff..6f4f3fcdb 100644 --- a/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/task.md +++ b/9-regular-expressions/11-regexp-groups/03-find-decimal-numbers/task.md @@ -1,11 +1,11 @@ -# Find all numbers +# সকল নাম্বার খুঁজুন -Write a regexp that looks for all decimal numbers including integer ones, with the floating point and negative ones. +সকল ডেসিমেল (পূর্ণ সংখ্যা এবং ঋণাত্নক) সংখ্যা খুঁজার একটি রেগুলার এক্সপ্রেশন লিখুন। -An example of use: +উদাহরণস্বরুপ: ```js -let regexp = /your regexp/g; +let regexp = /আপনার প্যাটার্ন লিখুন/g; let str = "-1.5 0 2 -123.4."; diff --git a/9-regular-expressions/11-regexp-groups/04-parse-expression/solution.md b/9-regular-expressions/11-regexp-groups/04-parse-expression/solution.md index 130c57be3..7f993ff15 100644 --- a/9-regular-expressions/11-regexp-groups/04-parse-expression/solution.md +++ b/9-regular-expressions/11-regexp-groups/04-parse-expression/solution.md @@ -1,21 +1,22 @@ -A regexp for a number is: `pattern:-?\d+(\.\d+)?`. We created it in previous tasks. +সংখ্যা খুঁজার রেগুলার এক্সপ্রেশন: `pattern:-?\d+(\.\d+)?`। যা আমরা পূর্বের টাস্কে করেছিলাম। -An operator is `pattern:[-+*/]`. The hyphen `pattern:-` goes first in the square brackets, because in the middle it would mean a character range, while we just want a character `-`. +অপারেটর হল `pattern:[-+*/]`. হাইফেন `pattern:-` অবশ্যই ব্রাকেটের শুরুতে হতে হবে, কেননা মাঝে হলে এটি দ্বারা ক্যারাক্টারের রেঞ্জ বুঝায়, এখানে আমরা `-` কে ক্যারাক্টার হিসেবে ব্যবহার করতে চায়। -The slash `/` should be escaped inside a JavaScript regexp `pattern:/.../`, we'll do that later. +স্ল্যাশ `/` অবশ্যই জাভাস্ক্রিপ্টের রেগুলার এক্সপ্রেশনের মাঝে এস্কেপড `pattern:/.../` হয়, এটি আমরা এটি পরে দেখব। -We need a number, an operator, and then another number. And optional spaces between them. +আমাদের খুঁজা লাগবে একটি সংখ্যা অতঃপর একটি গাণিতিক চিহ্ন এবং শেষে আরো একটি সংখ্যা এবং তাদের মাঝের অতিরিক্ত স্পেস। -The full regular expression: `pattern:-?\d+(\.\d+)?\s*[-+*/]\s*-?\d+(\.\d+)?`. -It has 3 parts, with `pattern:\s*` between them: -1. `pattern:-?\d+(\.\d+)?` - the first number, -1. `pattern:[-+*/]` - the operator, -1. `pattern:-?\d+(\.\d+)?` - the second number. +সুতরাং রেগুলার এক্সপ্রেশনটি হবে: `pattern:-?\d+(\.\d+)?\s*[-+*/]\s*-?\d+(\.\d+)?`। -To make each of these parts a separate element of the result array, let's enclose them in parentheses: `pattern:(-?\d+(\.\d+)?)\s*([-+*/])\s*(-?\d+(\.\d+)?)`. +এর ৩টি অংশ আছে, সাথে এটিও `pattern:\s*`: +১. `pattern:-?\d+(\.\d+)?` - প্রথম সংখ্যাটি। +২. `pattern:[-+*/]` - গাণিতিক চিহ্নটি। +৩. `pattern:-?\d+(\.\d+)?` - দ্বিতীয় সংখ্যাটি। -In action: +তাদের প্রত্যেককে রেজাল্ট অ্যারের আলাদা আলাদা উপাদান হিসেবে রাখতে প্যারান্টেসিস দ্বারা গ্রুপ করি: `pattern:(-?\d+(\.\d+)?)\s*([-+*/])\s*(-?\d+(\.\d+)?)`। + +যেমন: ```js run let regexp = /(-?\d+(\.\d+)?)\s*([-+*\/])\s*(-?\d+(\.\d+)?)/; @@ -23,22 +24,22 @@ let regexp = /(-?\d+(\.\d+)?)\s*([-+*\/])\s*(-?\d+(\.\d+)?)/; alert( "1.2 + 12".match(regexp) ); ``` -The result includes: +রেজাল্টে: -- `result[0] == "1.2 + 12"` (full match) -- `result[1] == "1.2"` (first group `(-?\d+(\.\d+)?)` -- the first number, including the decimal part) -- `result[2] == ".2"` (second group`(\.\d+)?` -- the first decimal part) -- `result[3] == "+"` (third group `([-+*\/])` -- the operator) -- `result[4] == "12"` (forth group `(-?\d+(\.\d+)?)` -- the second number) -- `result[5] == undefined` (fifth group `(\.\d+)?` -- the last decimal part is absent, so it's undefined) +- `result[0] == "1.2 + 12"` (সম্পূর্ন এক্সপ্রেশনটি) +- `result[1] == "1.2"` (প্রথম গ্রুপ `(-?\d+(\.\d+)?)` -- প্রথম সংখ্যাটি, দশমিক অংশটিসহ) +- `result[2] == ".2"` (দ্বিতীয় গ্রুপ`(\.\d+)?` -- প্রথম দশমিক অংশটি) +- `result[3] == "+"` (তৃতীয় গ্রুপ `([-+*\/])` -- গাণিতিক চিহ্নটি) +- `result[4] == "12"` (চতুর্থ গ্রুপ `(-?\d+(\.\d+)?)` -- দ্বিতীয় সংখ্যাটি) +- `result[5] == undefined` (পঞ্চম গ্রুপ `(\.\d+)?` -- দ্বিতীয় দশমিক অংশটি অনুপস্থিত, সুতরাং এটি undefined) -We only want the numbers and the operator, without the full match or the decimal parts, so let's "clean" the result a bit. +আমরা শুধু সংখ্যাগুলো এবং গাণিতিক চিহ্নটি চায়, সম্পূর্ন অংশটি বা দশমিক অংশটি চায় না, সুতরাং আমাদের রেজাল্টকে আরো কিছুটা "clean" করি। -The full match (the arrays first item) can be removed by shifting the array `result.shift()`. +সম্পূর্ন অংশটি যা অ্যারের প্রথম ইলিমেন্ট একে আমরা `result.shift()` মেথডের সাহায্যে বাদ দিতে পারি। -Groups that contain decimal parts (number 2 and 4) `pattern:(.\d+)` can be excluded by adding `pattern:?:` to the beginning: `pattern:(?:\.\d+)?`. +যে গ্রুপগুলোতে দশমিক অংশ থাকে (২ এবং ৪ আইটেম) এই অংশের `pattern:(.\d+)` শুরুতে `pattern:?:` যোগ করে তাদের বাদ দিতে পারি: `pattern:(?:\.\d+)?`। -The final solution: +সুতরাং সমাধানটি হবে: ```js run function parse(expr) { diff --git a/9-regular-expressions/11-regexp-groups/04-parse-expression/task.md b/9-regular-expressions/11-regexp-groups/04-parse-expression/task.md index 8b54d4683..7e45e5585 100644 --- a/9-regular-expressions/11-regexp-groups/04-parse-expression/task.md +++ b/9-regular-expressions/11-regexp-groups/04-parse-expression/task.md @@ -1,23 +1,23 @@ -# Parse an expression +# এক্সপ্রেশনকে পার্স -An arithmetical expression consists of 2 numbers and an operator between them, for instance: +একটি গাণিতিক সমীকরণে দুটি নাম্বার এবং তাদের মাঝে একটি গাণিতিক চিহ্ন আছে, যেমন: - `1 + 2` - `1.2 * 3.4` - `-3 / -6` - `-2 - 2` -The operator is one of: `"+"`, `"-"`, `"*"` or `"/"`. +গাণিতিক চিহ্নগুলো হল: `"+"`, `"-"`, `"*"` অথবা `"/"`। -There may be extra spaces at the beginning, at the end or between the parts. +এখানে সমীকরণের শুরুতে,মাঝে এবং শেষে অতিরিক্ত স্পেস থাকতে পারে। -Create a function `parse(expr)` that takes an expression and returns an array of 3 items: +একটি ফাংশন লিখুন যা `parse(expr)` একটি সমীকরণ নিবে এবং তাদের কে একটি অ্যারের ৩ টি উপাদান হিসেবে রিটার্ন করবে: -1. The first number. -2. The operator. -3. The second number. +১. প্রথম সংখ্যাটি। +২. গাণিতিক চিহ্নটি। +৩. দ্বিতীয় সংখ্যাটি। -For example: +যেমন: ```js let [a, op, b] = parse("1.2 * 3.4"); diff --git a/9-regular-expressions/11-regexp-groups/article.md b/9-regular-expressions/11-regexp-groups/article.md index e559fd87c..49e580e5b 100644 --- a/9-regular-expressions/11-regexp-groups/article.md +++ b/9-regular-expressions/11-regexp-groups/article.md @@ -1,31 +1,31 @@ -# Capturing groups +# গ্রুপ ক্যাপচারিং -A part of a pattern can be enclosed in parentheses `pattern:(...)`. This is called a "capturing group". +প্যাটার্নের কোন একটা অংশকে প্যারেন্টেসিস `pattern:(...)` দ্বারা লিখাকে "গ্রুপ ক্যাপচারিং" বলে। -That has two effects: +এর ফলে ফলাফলে দুটি পরিবর্তন আছে: -1. It allows to get a part of the match as a separate item in the result array. -2. If we put a quantifier after the parentheses, it applies to the parentheses as a whole. +১. এটি দ্বারা লব্ধ ফলাফলের অ্যারেতে কোন একটা অংশকে আলাদা পজিশনে রাখা যায়। +২. যদি প্যারেন্টেসিসের পরে আমরা কোয়ান্টিফায়ার রাখি, এটি সম্পূর্ন গ্রুপের জন্য কাজ করবে। -## Examples +## উদাহরণ -Let's see how parentheses work in examples. +চলুন উদাহরণ দিয়ে দেখি গ্রুপ ক্যাপচারিং কিভাবে কাজ করে। -### Example: gogogo +### উদাহরণ: gogogo -Without parentheses, the pattern `pattern:go+` means `subject:g` character, followed by `subject:o` repeated one or more times. For instance, `match:goooo` or `match:gooooooooo`. +প্যারেন্টেসিস ছাড়া, এই প্যাটার্নটি `pattern:go+` দ্বারা বুঝায় `subject:g` এবং `subject:o` এই দুটি ক্যারাক্টার এক বা একাধিকবার পুনরাবৃত্তি হবে। উদাহরণস্বরুপ, `match:goooo` অথবা `match:gooooooooo`। -Parentheses group characters together, so `pattern:(go)+` means `match:go`, `match:gogo`, `match:gogogo` and so on. +প্যারেন্টেসিস দ্বারা গ্রুপ ক্যারাক্টারগুলো একসাথে বুঝায়, সুতরাং `pattern:(go)+` দ্বারা প্রাপ্তমিলগুলো হতে পারে `match:go`, `match:gogo`, `match:gogogo` অনুরূপ আরো অনেক। ```js run alert( 'Gogogo now!'.match(/(go)+/ig) ); // "Gogogo" ``` -### Example: domain +### উদাহরণ: ডোমেন -Let's make something more complex -- a regular expression to search for a website domain. +চলুন আরো কঠিন কিছু করি -- রেগুলার এক্সপ্রেশন দ্বারা ওয়েবসাইটের ডোমেন খুঁজে বের করা। -For example: +যেমন: ``` mail.com @@ -33,9 +33,9 @@ users.mail.com smith.users.mail.com ``` -As we can see, a domain consists of repeated words, a dot after each one except the last one. +এইক্ষেত্রে আমরা দেখছি, ডোমেনে শেষ শব্দটি ব্যতীত প্রতিটি শব্দের শেষে একটি ডট থাকবে। -In regular expressions that's `pattern:(\w+\.)+\w+`: +রেগুলার এক্সপ্রেশন আমরা এটি এভাবে লিখতে পারি `pattern:(\w+\.)+\w+`: ```js run let regexp = /(\w+\.)+\w+/g; @@ -43,17 +43,17 @@ let regexp = /(\w+\.)+\w+/g; alert( "site.com my.site.com".match(regexp) ); // site.com,my.site.com ``` -The search works, but the pattern can't match a domain with a hyphen, e.g. `my-site.com`, because the hyphen does not belong to class `pattern:\w`. +এটি কাজ করছে, কিন্তু উপরের প্যাটার্নটি হাইফেনসহ ডোমেনের জন্য সঠিকভাবে কাজ করবে না, যেমন. `my-site.com`, কেননা `pattern:\w` এই ক্যারাক্টার ক্লাস দ্বারা হাইফেনকে নির্দেশিত করা যায় না। -We can fix it by replacing `pattern:\w` with `pattern:[\w-]` in every word except the last one: `pattern:([\w-]+\.)+\w+`. +`pattern:\w` এর পরিবর্তে `pattern:[\w-]` লিখার মাধ্যমে আমরা এটিকে নির্ভুল করতে পারি সুতরাং প্যাটার্নটি হবে: `pattern:([\w-]+\.)+\w+`। -### Example: email +### উদাহরণ: ইমেইল -The previous example can be extended. We can create a regular expression for emails based on it. +পূর্ববর্তী উদাহরণটিকে কিছুটা বর্ধিত করে আমরা ইমেইল এর জন্য একটি রেগুলার এক্সপ্রেশন লিখতে পারি। -The email format is: `name@domain`. Any word can be the name, hyphens and dots are allowed. In regular expressions that's `pattern:[-.\w]+`. +ইমেইল এর ফরম্যাট: `name@domain`। নামের মধ্যে ডট হাইফেন ইত্যাদি থাকতে পারে। সুতরাং রেগুলার এক্সপ্রেশনটি হবে `pattern:[-.\w]+`। -The pattern: +প্যাটার্ন: ```js run let regexp = /[-.\w]+@([\w-]+\.)+[\w-]+/g; @@ -61,24 +61,24 @@ let regexp = /[-.\w]+@([\w-]+\.)+[\w-]+/g; alert("my@mail.com @ his@site.com.uk".match(regexp)); // my@mail.com, his@site.com.uk ``` -That regexp is not perfect, but mostly works and helps to fix accidental mistypes. The only truly reliable check for an email can only be done by sending a letter. +এটি পুরোপুরি নির্ভুল নই, কিন্তু বেশিরভাগক্ষেত্রে অ্যাক্সিডেন্টালি ভুল টাইপিং এড়ানোর জন্য কাজের। আমরা একটি ইমেইল নির্ভুল কিনা তা যাচাই করতে পারি শুধুমাত্র ইমেইল প্রেরণের মাধ্যমে। -## Parentheses contents in the match +## রেজাল্টে প্যারেন্টেসিসের কন্টেন্টগুলো কিভাবে থাকে -Parentheses are numbered from left to right. The search engine memorizes the content matched by each of them and allows to get it in the result. +প্যারেন্টেসিসের কন্টেন্ট গুলোকে বাম থেকে ডানে হিসেব করা হয়। সার্চ ইঞ্জিন মিলকৃত সকল কন্টেন্টকে মনে রাখে এবং রেজাল্টে এদের পাওয়া যায়। -The method `str.match(regexp)`, if `regexp` has no flag `g`, looks for the first match and returns it as an array: +`str.match(regexp)` মেথড, যদি `regexp` কোন `g` ফ্ল্যাগ না থাকে, তাহলে প্রথম মিলটি খুঁজে এবং এটি অ্যারে হিসেবে দেখায়: -1. At index `0`: the full match. -2. At index `1`: the contents of the first parentheses. -3. At index `2`: the contents of the second parentheses. -4. ...and so on... +১. `0` তম ইনডেক্সে: সম্পূর্ণ মিলটি। +২. `1` তম ইনডেক্সে: প্রথম প্যারেন্টেসিসের মিলগুলো। +৩. `2` তম ইনডেক্সে: দ্বিতীয় প্যারেন্টেসিসের মিলগুলো। +৪. ...এভাবেই চলতে থাকে... -For instance, we'd like to find HTML tags `pattern:<.*?>`, and process them. It would be convenient to have tag content (what's inside the angles), in a separate variable. +উদাহরণস্বরূপ, আমরা HTML ট্যাগ `pattern:<.*?>` খুঁজে পেতে চাই, এবং এদের নিয়ে কাজ করতে চাই। এজন্য আমাদের ট্যাগগুলো এবং ট্যাগের নাম গুলো আলাদা আলাদা ভ্যারিয়েবলে রাখা সুবিধাজনক। -Let's wrap the inner content into parentheses, like this: `pattern:<(.*?)>`. +চলুন ট্যাগ নামগুলোকে আমরা প্যারেন্টেসিসের দ্বারা আবদ্ধ করি, এভাবে: `pattern:<(.*?)>`। -Now we'll get both the tag as a whole `match: