From c4dfdf370be72c8426f188c8b7274a27a2ccc188 Mon Sep 17 00:00:00 2001 From: Saiful Date: Sat, 30 May 2020 21:55:48 +0600 Subject: [PATCH 1/3] translate sets and rangs --- .../article.md | 170 +++++++++--------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/9-regular-expressions/08-regexp-character-sets-and-ranges/article.md b/9-regular-expressions/08-regexp-character-sets-and-ranges/article.md index cb6a27e9d..240cb4fb9 100644 --- a/9-regular-expressions/08-regexp-character-sets-and-ranges/article.md +++ b/9-regular-expressions/08-regexp-character-sets-and-ranges/article.md @@ -1,169 +1,169 @@ -# Sets and ranges [...] +# সেট এবং রেঞ্জ [...] -Several characters or character classes inside square brackets `[…]` mean to "search for any character among given". +তৃতীয় বন্ধনীর `[…]` এর মধ্যে বিভিন্ন ক্যারাক্টার অথবা বিভিন্ন ক্যারাক্টার ক্লাসের দ্বারা বুঝায় "প্রদত্ত ক্যারাক্টারসমূহের যেকোন একটি ক্যারাক্টার থাকতে পারে"। -## Sets +## সেট -For instance, `pattern:[eao]` means any of the 3 characters: `'a'`, `'e'`, or `'o'`. +উদাহরণস্বরূপ, `pattern:[eao]` এর মানে `'a'`, `'e'`, বা `'o'` এ ৩টি ক্যারাক্টারের যেকোন একটি। -That's called a *set*. Sets can be used in a regexp along with regular characters: +একে বলা হয় *সেট*। রেগুলার এক্সপ্রেশন প্যাটার্নে রেগুলার ক্যারাক্টারের সাথে সেটও ব্যবহার করা যায়: ```js run -// find [t or m], and then "op" +// প্রথমে [t বা m] খুঁজবে, এবং তারপর "op" alert( "Mop top".match(/[tm]op/gi) ); // "Mop", "top" ``` -Please note that although there are multiple characters in the set, they correspond to exactly one character in the match. +দয়া করে মনে রাখা উচিত সেটে অনেক ক্যারাক্টার থাকলেও, এরা যেকোন একটি ক্যারাক্টারের সাথে ম্যাচ করে। -So the example below gives no matches: +সুতরাং নিচের উদাহরণটিতে কোন ম্যাচ হবেনা: ```js run -// find "V", then [o or i], then "la" -alert( "Voila".match(/V[oi]la/) ); // null, no matches +// প্রথমে "V", তারপর [o অথবা i], তারপর "la" +alert( "Voila".match(/V[oi]la/) ); // null, কোন ম্যাচ হবেনা ``` -The pattern searches for: +প্যাটার্নটি এভাবে সার্চ করে: - `pattern:V`, -- then *one* of the letters `pattern:[oi]`, -- then `pattern:la`. +- তারপর যেকোন *একটি* অক্ষর `pattern:[oi]`, +- তারপর `pattern:la`। -So there would be a match for `match:Vola` or `match:Vila`. +সুতরাং এটি `match:Vola` অথবা `match:Vila` এর সাথে ম্যাচ হতে পারে। -## Ranges +## রেঞ্জ -Square brackets may also contain *character ranges*. +তৃতীয় বন্ধনীতে *ক্যারাক্টারের রেঞ্জ*-ও থাকতে পারে। -For instance, `pattern:[a-z]` is a character in range from `a` to `z`, and `pattern:[0-5]` is a digit from `0` to `5`. +উদাহরণস্বরূপ, `pattern:[a-z]` হল `a` হতে `z` পর্যন্ত ক্যারাক্টারসমূহের রেঞ্জ, এবং `pattern:[0-5]` হল `0` হতে `5` ডিজিটসমূহের রেঞ্জ। -In the example below we're searching for `"x"` followed by two digits or letters from `A` to `F`: +নিচের উদাহরণটিতে আমরা হেক্সাডেসিমেল সংখ্যার জন্য `"x"` এর পর দুটি ডিজিট অথবা `A` to `F` পর্যন্ত অক্ষরগুলো খুঁজি: ```js run alert( "Exception 0xAF".match(/x[0-9A-F][0-9A-F]/g) ); // xAF ``` -Here `pattern:[0-9A-F]` has two ranges: it searches for a character that is either a digit from `0` to `9` or a letter from `A` to `F`. +এখানে `pattern:[0-9A-F]` এর দুটি রেঞ্জ রয়েছে: এটি সার্চ করে কোন ক্যারাক্টার `0` হতে `9` অথবা `A` হতে `F` এর মধ্যে আছে কিনা তা চেক করে। -If we'd like to look for lowercase letters as well, we can add the range `a-f`: `pattern:[0-9A-Fa-f]`. Or add the flag `pattern:i`. +যদি আমরা ছোট হাতের অক্ষর দিয়েও খুঁজতে চাই, আমরা এই `a-f` রেঞ্জটাও যুক্ত করতে পারি: `pattern:[0-9A-Fa-f]`। অথবা এই ফ্ল্যাগটাও `pattern:i` যুক্ত করতে পারি। -We can also use character classes inside `[…]`. +আমরা `[…]` এর মধ্যে ক্যারাক্টার ক্লাসও ব্যবহার করতে পারি। -For instance, if we'd like to look for a wordly character `pattern:\w` or a hyphen `pattern:-`, then the set is `pattern:[\w-]`. +উদাহরণস্বরূপ, যদি আমরা কোন ওয়ার্ডলি ক্যারাক্টার `pattern:\w` অথবা হাইফেন `pattern:-` খুঁজতে চাই সেটটি হবে এমন `pattern:[\w-]`। -Combining multiple classes is also possible, e.g. `pattern:[\s\d]` means "a space character or a digit". +অনেকগুলো ক্লাসকে একসাথে করা যায়, যেমন `pattern:[\s\d]` দ্বারা বুঝায় "একটি স্পেস ক্যারাক্টার অথবা একটি ডিজিট"। -```smart header="Character classes are shorthands for certain character sets" -For instance: +```smart header="ক্যারাক্টার ক্লাসগুলো নির্দিষ্ট ক্যারাক্টার সেটের শর্টহ্যান্ড" +উদাহরণস্বরূপ: -- **\d** -- is the same as `pattern:[0-9]`, -- **\w** -- is the same as `pattern:[a-zA-Z0-9_]`, -- **\s** -- is the same as `pattern:[\t\n\v\f\r ]`, plus few other rare unicode space characters. +- **\d** -- এটি `pattern:[0-9]` এর মত, +- **\w** -- এটি `pattern:[a-zA-Z0-9_]` এর মত, +- **\s** -- এটি `pattern:[\t\n\v\f\r ]` এর মত, এছাড়াও আরো কিছু ইউনিকোড স্পেস ক্যারাক্টার। ``` -### Example: multi-language \w +### উদাহরণ: মাল্টি-ল্যাংগুয়েজ \w -As the character class `pattern:\w` is a shorthand for `pattern:[a-zA-Z0-9_]`, it can't find Chinese hieroglyphs, Cyrillic letters, etc. +যেহেতু `pattern:[a-zA-Z0-9_]` এর শর্টহ্যান্ড ক্যারাক্টার ক্লাস হল `pattern:\w`, তাই এটি দ্বারা চাইনিজ, সিরিলিক ইত্যাদি ভাষার অক্ষরগুলো পাওয়া যায় না। -We can write a more universal pattern, that looks for wordly characters in any language. That's easy with unicode properties: `pattern:[\p{Alpha}\p{M}\p{Nd}\p{Pc}\p{Join_C}]`. +আমরা আরো সহজে প্যাটার্ন লিখতে পারি, যা দ্বারা যেকোন ভাষার ওয়ার্ডলি ক্যারাক্টার খুঁজা যায়। ইউনিকোড প্রপার্টি দ্বারা সহজে করা যায়: `pattern:[\p{Alpha}\p{M}\p{Nd}\p{Pc}\p{Join_C}]`। -Let's decipher it. Similar to `pattern:\w`, we're making a set of our own that includes characters with following unicode properties: +চলুন এর মর্মার্থ বুঝি. এটি `pattern:\w` এর মত আমরা নিজেদের একটি সেট তৈরি করেছি যাতে নিম্নলিখিত ইউনিকোড বৈশিষ্ট্যযুক্ত অক্ষরসমূহ অন্তর্ভুক্ত: -- `Alphabetic` (`Alpha`) - for letters, -- `Mark` (`M`) - for accents, -- `Decimal_Number` (`Nd`) - for digits, -- `Connector_Punctuation` (`Pc`) - for the underscore `'_'` and similar characters, -- `Join_Control` (`Join_C`) - two special codes `200c` and `200d`, used in ligatures, e.g. in Arabic. +- `Alphabetic` (`Alpha`) - বর্ণের জন্য, +- `Mark` (`M`) - অ্যাকসেন্টের জন্য, +- `Decimal_Number` (`Nd`) - ডিজিটের জন্য, +- `Connector_Punctuation` (`Pc`) - আন্ডারস্কোর `'_'` এবং এ ধরণের ক্যারাক্টারের জন্য, +- `Join_Control` (`Join_C`) - দুটি বিশেষ কোড `200c` এবং `200d`, লিগচারে ব্যবহৃত হয় যেমন আরবীতে। -An example of use: +উদাহরণস্বরূপ: ```js run let regexp = /[\p{Alpha}\p{M}\p{Nd}\p{Pc}\p{Join_C}]/gu; let str = `Hi 你好 12`; -// finds all letters and digits: +// সব অক্ষর এবং ডিজিট পাব: alert( str.match(regexp) ); // H,i,你,好,1,2 ``` -Of course, we can edit this pattern: add unicode properties or remove them. Unicode properties are covered in more details in the article . +অবশ্যই, আমরা প্যাটার্নটি ইডিট করতে পারি: নতুন প্রপার্টি সংযুক্ত বা বাদ দিতে পারি। ইউনিকোড প্রপার্টি সম্পর্কে বিস্তারিত এখানে জানতে পারবেন । -```warn header="Unicode properties aren't supported in Edge and Firefox" -Unicode properties `pattern:p{…}` are not yet implemented in Edge and Firefox. If we really need them, we can use library [XRegExp](http://xregexp.com/). +```warn header="ইউনিকোড প্রপার্টি ফায়ারফক্স এবং এজে সমর্থিত নয়" +ইউনিকোড প্রপার্টিসমূহ `pattern:p{…}` ফায়ারফক্স এবং এজে সমর্থিত নয়. যদি আমাদের দরকার হয়, তাহলে এই লাইব্রেরীটি ব্যবহার করতে হবে [XRegExp](http://xregexp.com/)। -Or just use ranges of characters in a language that interests us, e.g. `pattern:[а-я]` for Cyrillic letters. +অথবা শুধু নির্দিষ্ট ভাষার রেঞ্জ ব্যবহার করতে পারি, যেমন: `pattern:[а-я]` সিরিলিক বর্ণের জন্য। ``` -## Excluding ranges +## এক্সক্লুডিং রেঞ্জ -Besides normal ranges, there are "excluding" ranges that look like `pattern:[^…]`. +নরমাল রেঞ্জের পাশাপাশি "এক্সক্লুডিং" রেঞ্জ আছে যার প্যাটার্নটি এমন `pattern:[^…]`। -They are denoted by a caret character `^` at the start and match any character *except the given ones*. +এটি রেঞ্জের শুরুতে ক্যারেট ক্যারাক্টার `^` দ্বারা লিখা হয় এবং *শুধুমাত্র রেঞ্জ সেটটি ব্যতীত* বাকী সকল ধরণের ক্যারাক্টারের সাথে ম্যাচ হয়। -For instance: +উদাহরণস্বরূপ: -- `pattern:[^aeyo]` -- any character except `'a'`, `'e'`, `'y'` or `'o'`. -- `pattern:[^0-9]` -- any character except a digit, the same as `pattern:\D`. -- `pattern:[^\s]` -- any non-space character, same as `\S`. +- `pattern:[^aeyo]` -- `'a'`, `'e'`, `'y'` বা `'o'` ব্যতীত যেকোন ক্যারাক্টার। +- `pattern:[^0-9]` -- ডিজিট ব্যতীত যেকোন ক্যারাক্টার, `pattern:\D` এর মত। +- `pattern:[^\s]` -- যেকোন নন-স্পেস ক্যারাক্টার, `\S` এর মত। -The example below looks for any characters except letters, digits and spaces: +নিচের উদাহরণটিতে অক্ষর, ডিজিট, স্পেস ব্যতীত অন্যান্য ক্যারাক্টার পাব: ```js run -alert( "alice15@gmail.com".match(/[^\d\sA-Z]/gi) ); // @ and . +alert( "alice15@gmail.com".match(/[^\d\sA-Z]/gi) ); // @ এবং . ``` -## Escaping in […] +## […] এস্কেপিং -Usually when we want to find exactly a special character, we need to escape it like `pattern:\.`. And if we need a backslash, then we use `pattern:\\`, and so on. +সাধারণত যখন আমরা স্পেশাল ক্যারাক্টার খুঁজি আমাদের ক্যারাক্টারটিকে এস্কেপ করে নিতে হয় যেমন `pattern:\.`, ব্যাকস্ল্যাশের জন্য `pattern:\\` ইত্যাদি। -In square brackets we can use the vast majority of special characters without escaping: +তবে তৃতীয় বন্ধনীর এর মধ্যে বেশিরভাগ স্পেশাল ক্যারাক্টার এস্কেপিং ছাড়া ব্যবহার করা যায়: -- Symbols `pattern:. + ( )` never need escaping. -- A hyphen `pattern:-` is not escaped in the beginning or the end (where it does not define a range). -- A caret `pattern:^` is only escaped in the beginning (where it means exclusion). -- The closing square bracket `pattern:]` is always escaped (if we need to look for that symbol). +- সিম্বলস `pattern:. + ( )` এস্কেপিংয়ের প্রয়োজন নেই। +- হাইফেন `pattern:-` শুরুতে অথবা শেষে এস্কেপিংয়ের প্রয়োজন নেই (যখন এটি দ্বারা রেঞ্জ বুঝায় না)। +- ক্যারেট `pattern:^` শুধুমাত্র শুরুতে এস্কেপ করে নিতে হয় (যেখানে এটি দ্বারা বুঝানো হয় সেটটি ব্যতীত)। +- ক্লোজিং ব্রাকেট `pattern:]` কে সর্বদা এস্কেপ করতে হয় (যদি আমাদের এটি ম্যাচ করতে হয়)। -In other words, all special characters are allowed without escaping, except when they mean something for square brackets. +অন্যার্থে বলা যায়, তৃতীয় বন্ধনীতে যেসব স্পেশাল ক্যারাক্টার ব্যবহৃত হয় সেসব ব্যতীত সকল স্পেশাল ক্যারাক্টার এস্কেপিং ছাড়া ব্যবহার করতে পারব। -A dot `.` inside square brackets means just a dot. The pattern `pattern:[.,]` would look for one of characters: either a dot or a comma. +তৃতীয় বন্ধনীতে ডট `.` দ্বারা শুধুমাত্র ডট বুঝায়। প্যাটার্নটি `pattern:[.,]` যেকোন একটি ক্যারাক্টার খুঁজবে: ডট অথবা কমা। -In the example below the regexp `pattern:[-().^+]` looks for one of the characters `-().^+`: +নিম্নের উদাহরণে `pattern:[-().^+]` প্যাটার্নটি `-().^+` এসব ক্যারাক্টার খুঁজবে: ```js run -// No need to escape +// এস্কেপ করার প্রয়োজন নেই let regexp = /[-().^+]/g; alert( "1 + 2 - 3".match(regexp) ); // Matches +, - ``` -...But if you decide to escape them "just in case", then there would be no harm: +...কিন্তু আপনি যদি "কোন ক্ষেত্রে" এদের এস্কেপ করেন, তাহলেও এটি আগের উদাহরণের মত কাজ করবে: ```js run -// Escaped everything +// সব ক্যারাক্টারকে এস্কিপিং করা হয়েছে let regexp = /[\-\(\)\.\^\+]/g; -alert( "1 + 2 - 3".match(regexp) ); // also works: +, - +alert( "1 + 2 - 3".match(regexp) ); // এটিও কাজ করে: +, - ``` -## Ranges and flag "u" +## রেঞ্জ এবং ফ্ল্যাগ "u" -If there are surrogate pairs in the set, flag `pattern:u` is required for them to work correctly. +যদি সেটে কোন "সারোগেট জোড়" থাকে, তাহলে সঠিকভাবে কাজ করার জন্য `pattern:u` ফ্ল্যাগটি ব্যবহার করতে হবে। -For instance, let's look for `pattern:[𝒳𝒴]` in the string `subject:𝒳`: +উদাহরণস্বরূপ, চলুন এই স্ট্রিংয়ে `subject:𝒳` আমরা এই প্যাটার্নটি খুঁজি `pattern:[𝒳𝒴]`: ```js run -alert( '𝒳'.match(/[𝒳𝒴]/) ); // shows a strange character, like [?] -// (the search was performed incorrectly, half-character returned) +alert( '𝒳'.match(/[𝒳𝒴]/) ); // এমন [?] অদ্ভুত একটি ক্যারাক্টার দেখাবে +// (সার্চিংটি সঠিকভাবে কাজ করবে না, হাফ-ক্যারেক্টার রিটার্ন করবে) ``` -The result is incorrect, because by default regular expressions "don't know" about surrogate pairs. +রেজাল্টটি সঠিকভাবে পাব না, কেননা ডিফল্টভাবে রেগুলার এক্সপ্রেশন "সারোগেট জোড়" সম্পর্কে জানেনা। -The regular expression engine thinks that `[𝒳𝒴]` -- are not two, but four characters: -1. left half of `𝒳` `(1)`, -2. right half of `𝒳` `(2)`, -3. left half of `𝒴` `(3)`, -4. right half of `𝒴` `(4)`. +রেগুলার এক্সপ্রেশন ইঞ্জিন `[𝒳𝒴]` -- একে দুটি ক্যারাক্টারের বদলে চারটি ক্যারাক্টার ভাবে: +1. `𝒳` `(1)` এর বামের অর্ধেক, +2. `𝒳` `(2)` এর ডানের অর্ধেক, +3. `𝒴` `(3)` এর বামের অর্ধেক, +4. `𝒴` `(4)` এর ডানের অর্ধেক। -We can see their codes like this: +নিম্নে আমরা তাদের কোডগুলো দেখতে পাই: ```js run for(let i=0; i<'𝒳𝒴'.length; i++) { @@ -171,27 +171,27 @@ for(let i=0; i<'𝒳𝒴'.length; i++) { }; ``` -So, the example above finds and shows the left half of `𝒳`. +সুতরাং, উপরের উদাহরণে আমরা `𝒳` এর বামের অর্ধেক পাই। -If we add flag `pattern:u`, then the behavior will be correct: +যদি আমরা ফ্ল্যাগ `pattern:u` ব্যবহার করি, তাহলে এটি সঠিকভাবে কাজ করবে: ```js run alert( '𝒳'.match(/[𝒳𝒴]/u) ); // 𝒳 ``` -The similar situation occurs when looking for a range, such as `[𝒳-𝒴]`. +রেঞ্জের জন্যও এই ঘটনাটি ঘটে, যেমন `[𝒳-𝒴]`। -If we forget to add flag `pattern:u`, there will be an error: +যদি আমরা ফ্ল্যাগ `pattern:u` ব্যবহার না করি, তাহলে একটি ইরোর পাব: ```js run '𝒳'.match(/[𝒳-𝒴]/); // Error: Invalid regular expression ``` -The reason is that without flag `pattern:u` surrogate pairs are perceived as two characters, so `[𝒳-𝒴]` is interpreted as `[<55349><56499>-<55349><56500>]` (every surrogate pair is replaced with its codes). Now it's easy to see that the range `56499-55349` is invalid: its starting code `56499` is greater than the end `55349`. That's the formal reason for the error. +ফ্ল্যাগ `pattern: u` ছাড়া "সারোগেট জোড়া" এর কারণে দুটি অক্ষর হিসেবে বিবেচনা করে, সুতরাং `[𝒳-𝒴]` এটি এভাবে `[<55349><56499>-<55349><56500>]` বিবেচিত হয় (প্রতিটি সারোগেট জোড় তার কোড দ্বারা প্রতিস্থাপিত হয়)। এখন রেঞ্জটি এভাবে বিবেচিত হয় `56499-55349` যা ইনভ্যালিড: কেননা রেঞ্জের শুরুর ক্যারাক্টারটি `56499` শেষের ক্যারাক্টার হতে বড় `55349`। এই কারণেই ইরোরটি সংঘটিত হয়। -With the flag `pattern:u` the pattern works correctly: +ফ্ল্যাগ `pattern:u` এর সাথে প্যাটার্নটি সঠিকভাবে কাজ করে: ```js run -// look for characters from 𝒳 to 𝒵 +// 𝒳 to 𝒵 পর্যন্ত ক্যারাক্টার সমূহকে খুঁজে alert( '𝒴'.match(/[𝒳-𝒵]/u) ); // 𝒴 ``` From 1d174a1522981559297adc3ffdb4379c935eb58a Mon Sep 17 00:00:00 2001 From: Saiful Date: Sat, 30 May 2020 22:12:55 +0600 Subject: [PATCH 2/3] translate task1 --- .../1-find-range-1/solution.md | 6 +++--- .../1-find-range-1/task.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/solution.md b/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/solution.md index 378471611..82eb4e509 100644 --- a/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/solution.md +++ b/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/solution.md @@ -1,11 +1,11 @@ -Answers: **no, yes**. +উত্তর: **না, হ্যাঁ**। -- In the script `subject:Java` it doesn't match anything, because `pattern:[^script]` means "any character except given ones". So the regexp looks for `"Java"` followed by one such symbol, but there's a string end, no symbols after it. +- `subject:Java` এ কোন কিছুর সাথে ম্যাচ হবেনা, কারন `pattern:[^script]` দ্বারা বুঝায় "প্রদত্ত ক্যারাক্টার ব্যতীত যেকোন ক্যারাক্টার"। সুতরাং রেগুলার এক্সপ্রেশনটি `"Java"` এর পর যেকোন একটি ক্যারাক্টার খুঁজে, কিন্তু স্ট্রিংটির শেষে কোন ক্যারাক্টার নেই। ```js run alert( "Java".match(/Java[^script]/) ); // null ``` -- Yes, because the part `pattern:[^script]` part matches the character `"S"`. It's not one of `pattern:script`. As the regexp is case-sensitive (no `pattern:i` flag), it treats `"S"` as a different character from `"s"`. +- হ্যাঁ, কারণ `pattern:[^script]` অংশটি `"S"` ক্যারাক্টারের সাথে ম্যাচ করে। `"S"` ক্যারাক্টারটি `pattern:script` এর মধ্যে নেই। যেহেতু রেগুলার এক্সপ্রেশন কেস-সেনসিটিভ (কোন `pattern:i` ফ্ল্যাগ নেই), তাই ক্যারাক্টার `"S"` এবং `"s"` কে আলাদা হিসেবে বিবেচনা করে। ```js run alert( "JavaScript".match(/Java[^script]/) ); // "JavaS" diff --git a/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/task.md b/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/task.md index 5a48e01e7..bf3f739b2 100644 --- a/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/task.md +++ b/9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/task.md @@ -1,5 +1,5 @@ # Java[^script] -We have a regexp `pattern:/Java[^script]/`. +আমাদের এ ধরণের একটি প্যাটার্ন আছে `pattern:/Java[^script]/`। -Does it match anything in the string `subject:Java`? In the string `subject:JavaScript`? +এটি কি এই স্ট্রিংয়ের `subject:Java` সাথে ম্যাচ হবে? অথবা এই স্ট্রিংয়ের `subject:JavaScript`? From 5c9e272783d6ae03dfb64d5962ce237def1c135e Mon Sep 17 00:00:00 2001 From: Saiful Date: Sat, 30 May 2020 22:26:20 +0600 Subject: [PATCH 3/3] tranlate task 2 --- .../2-find-time-2-formats/solution.md | 4 ++-- .../2-find-time-2-formats/task.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/solution.md b/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/solution.md index 69ade1b19..9830d049e 100644 --- a/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/solution.md +++ b/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/solution.md @@ -1,8 +1,8 @@ -Answer: `pattern:\d\d[-:]\d\d`. +উত্তর: `pattern:\d\d[-:]\d\d`. ```js run let regexp = /\d\d[-:]\d\d/g; alert( "Breakfast at 09:00. Dinner at 21-30".match(regexp) ); // 09:00, 21-30 ``` -Please note that the dash `pattern:'-'` has a special meaning in square brackets, but only between other characters, not when it's in the beginning or at the end, so we don't need to escape it. +দয়া করে মনে রাখা উচিত তৃতীয় বন্ধনীতে ড্যাশ `pattern:'-'` এর স্পেশাল অর্থ আছে, কিন্তু যদি দুটি ক্যারাক্টারের মাঝে ব্যবহার করি, কিন্তু শুরুতে অথবা শেষে ড্যাশ-ই বুঝায়, সুতরাং আমাদের এটি এস্কেপ করার প্রয়োজন নেই। diff --git a/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/task.md b/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/task.md index c8441caf4..2f35da7e7 100644 --- a/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/task.md +++ b/9-regular-expressions/08-regexp-character-sets-and-ranges/2-find-time-2-formats/task.md @@ -1,12 +1,12 @@ -# Find the time as hh:mm or hh-mm +# সময় খুঁজা hh:mm অথবা hh-mm -The time can be in the format `hours:minutes` or `hours-minutes`. Both hours and minutes have 2 digits: `09:00` or `21-30`. +সময়ের ফরম্যাট হতে পারে এভাবে `hours:minutes` অথবা `hours-minutes`. ঘন্টা এবং মিনিট উভয়েই দুই ডিজিটের হয়: `09:00` অথবা `21-30`. -Write a regexp to find time: +উপরোল্লিখিত ফরম্যাটে সময় খুঁজার জন্য প্যাটার্ন লিখুন: ```js let regexp = /your regexp/g; alert( "Breakfast at 09:00. Dinner at 21-30".match(regexp) ); // 09:00, 21-30 ``` -P.S. In this task we assume that the time is always correct, there's no need to filter out bad strings like "45:67". Later we'll deal with that too. +বি.দ্র. দুই ডিজিটের যেকোন সময় সঠিক হিসেবে বিবেচনা করতে পারি, আমাদের স্ট্রিং ভ্যালিডেশন নিয়ে চিন্তিত হতে হবে না যেমন "45:67"। পরবর্তীতে আমরা এটিও দেখব।