Skip to content

Commit 6aa6ba4

Browse files
committed
task-2
1 parent 44d41d7 commit 6aa6ba4

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
We need to look for `#` followed by 6 hexadecimal characters.
1+
আমাদের `#` এর পর ৬টি হেক্সাডেসিমেল ক্যারাক্টার খোঁজা লাগবে।
22

3-
A hexadecimal character can be described as `pattern:[0-9a-fA-F]`. Or if we use the `pattern:i` flag, then just `pattern:[0-9a-f]`.
3+
`pattern:[0-9a-fA-F]` এর মাধ্যমে আমরা হেক্সাডেসিমেল ক্যারাক্টার সংজ্ঞায়িত করতে পারি। অথবা যদি আমরা `pattern:i` ফ্ল্যাগ ব্যবহার করি তাহলে প্যাটার্নটি হবে `pattern:[0-9a-f]`
44

5-
Then we can look for 6 of them using the quantifier `pattern:{6}`.
5+
এখন আমরা কোয়ান্টিফায়ার `pattern:{6}` ব্যবহার করে ৬টি ক্যারাক্টার খুঁজতে পারি।
66

7-
As a result, we have the regexp: `pattern:/#[a-f0-9]{6}/gi`.
7+
ফলস্বরূপ, রেগুলার এক্সপ্রেশনটি হবে: `pattern:/#[a-f0-9]{6}/gi`
88

99
```js run
1010
let regexp = /#[a-f0-9]{6}/gi;
@@ -14,18 +14,18 @@ let str = "color:#121212; background-color:#AA00ef bad-colors:f#fddee #fd2"
1414
alert( str.match(regexp) ); // #121212,#AA00ef
1515
```
1616

17-
The problem is that it finds the color in longer sequences:
17+
তবে এর সমস্যা হল দীর্ঘতম সিক্যুয়েন্সেও এটি কালার খুঁজবে:
1818

1919
```js run
2020
alert( "#12345678".match( /#[a-f0-9]{6}/gi ) ) // #12345678
2121
```
2222

23-
To fix that, we can add `pattern:\b` to the end:
23+
শেষে `pattern:\b` সংযোজন করে আমরা এটি সমাধান করতে পারি:
2424

2525
```js run
26-
// color
26+
// সঠিক কালার কোড
2727
alert( "#123456".match( /#[a-f0-9]{6}\b/gi ) ); // #123456
2828

29-
// not a color
29+
// ভুল কালার কোড
3030
alert( "#12345678".match( /#[a-f0-9]{6}\b/gi ) ); // null
3131
```
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Regexp for HTML colors
1+
# এইচটিএমএল কালারের জন্য রেগুলার এক্সপ্রেশন
22

3-
Create a regexp to search HTML-colors written as `#ABCDEF`: first `#` and then 6 hexadecimal characters.
3+
হেক্সাডেসিমেল এইচটিএমএল কালার `#ABCDEF`: প্রথমে `#` তারপর ৬ টি হেক্সাডেসিমেল ক্যারাক্টার খোঁজার জন্য একটি রেগুলার এক্সপ্রেশন লিখুন।
44

5-
An example of use:
5+
ব্যবহারযোগ্য একটি উদাহরণ:
66

77
```js
8-
let regexp = /...your regexp.../
8+
let regexp = /...আপনার রেগুলার এক্সপ্রেশনটি লিখুন.../
99

1010
let str = "color:#121212; background-color:#AA00ef bad-colors:f#fddee #fd2 #12345678";
1111

1212
alert( str.match(regexp) ) // #121212,#AA00ef
1313
```
1414

15-
P.S. In this task we do not need other color formats like `#123` or `rgb(1,2,3)` etc.
15+
পুনশ্চ এই টাস্কে আমাদের `#123` বা `rgb(1,2,3)` ইত্যাদি কালার ফরমেটগুলোর প্রয়োজন নেই।

0 commit comments

Comments
 (0)