Skip to content

Commit f376923

Browse files
author
Md. Jamal Uddin
authored
Merge pull request #67 from msisaifu/sets-and-ranges
Sets and ranges
2 parents b2fdfbf + 5c9e272 commit f376923

File tree

5 files changed

+96
-96
lines changed

5 files changed

+96
-96
lines changed

Diff for: 9-regular-expressions/08-regexp-character-sets-and-ranges/1-find-range-1/solution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Answers: **no, yes**.
1+
উত্তর: **না, হ্যাঁ**
22

3-
- 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.
3+
- `subject:Java` এ কোন কিছুর সাথে ম্যাচ হবেনা, কারন `pattern:[^script]` দ্বারা বুঝায় "প্রদত্ত ক্যারাক্টার ব্যতীত যেকোন ক্যারাক্টার"। সুতরাং রেগুলার এক্সপ্রেশনটি `"Java"` এর পর যেকোন একটি ক্যারাক্টার খুঁজে, কিন্তু স্ট্রিংটির শেষে কোন ক্যারাক্টার নেই।
44

55
```js run
66
alert( "Java".match(/Java[^script]/) ); // null
77
```
8-
- 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"`.
8+
- হ্যাঁ, কারণ `pattern:[^script]` অংশটি `"S"` ক্যারাক্টারের সাথে ম্যাচ করে। `"S"` ক্যারাক্টারটি `pattern:script` এর মধ্যে নেই। যেহেতু রেগুলার এক্সপ্রেশন কেস-সেনসিটিভ (কোন `pattern:i` ফ্ল্যাগ নেই), তাই ক্যারাক্টার `"S"` এবং `"s"` কে আলাদা হিসেবে বিবেচনা করে।
99

1010
```js run
1111
alert( "JavaScript".match(/Java[^script]/) ); // "JavaS"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Java[^script]
22

3-
We have a regexp `pattern:/Java[^script]/`.
3+
আমাদের এ ধরণের একটি প্যাটার্ন আছে `pattern:/Java[^script]/`
44

5-
Does it match anything in the string `subject:Java`? In the string `subject:JavaScript`?
5+
এটি কি এই স্ট্রিংয়ের `subject:Java` সাথে ম্যাচ হবে? অথবা এই স্ট্রিংয়ের `subject:JavaScript`?
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Answer: `pattern:\d\d[-:]\d\d`.
1+
উত্তর: `pattern:\d\d[-:]\d\d`.
22

33
```js run
44
let regexp = /\d\d[-:]\d\d/g;
55
alert( "Breakfast at 09:00. Dinner at 21-30".match(regexp) ); // 09:00, 21-30
66
```
77

8-
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.
8+
দয়া করে মনে রাখা উচিত তৃতীয় বন্ধনীতে ড্যাশ `pattern:'-'` এর স্পেশাল অর্থ আছে, কিন্তু যদি দুটি ক্যারাক্টারের মাঝে ব্যবহার করি, কিন্তু শুরুতে অথবা শেষে ড্যাশ-ই বুঝায়, সুতরাং আমাদের এটি এস্কেপ করার প্রয়োজন নেই।
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Find the time as hh:mm or hh-mm
1+
# সময় খুঁজা hh:mm অথবা hh-mm
22

3-
The time can be in the format `hours:minutes` or `hours-minutes`. Both hours and minutes have 2 digits: `09:00` or `21-30`.
3+
সময়ের ফরম্যাট হতে পারে এভাবে `hours:minutes` অথবা `hours-minutes`. ঘন্টা এবং মিনিট উভয়েই দুই ডিজিটের হয়: `09:00` অথবা `21-30`.
44

5-
Write a regexp to find time:
5+
উপরোল্লিখিত ফরম্যাটে সময় খুঁজার জন্য প্যাটার্ন লিখুন:
66

77
```js
88
let regexp = /your regexp/g;
99
alert( "Breakfast at 09:00. Dinner at 21-30".match(regexp) ); // 09:00, 21-30
1010
```
1111

12-
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.
12+
বি.দ্র. দুই ডিজিটের যেকোন সময় সঠিক হিসেবে বিবেচনা করতে পারি, আমাদের স্ট্রিং ভ্যালিডেশন নিয়ে চিন্তিত হতে হবে না যেমন "45:67"। পরবর্তীতে আমরা এটিও দেখব।

0 commit comments

Comments
 (0)