-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from msisaifu/regexp-quantifiers
Quantifiers +, *, ? and {n}
- Loading branch information
Showing
5 changed files
with
64 additions
and
64 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
9-regular-expressions/09-regexp-quantifiers/1-find-text-manydots/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
Solution: | ||
সমাধান: | ||
|
||
```js run | ||
let regexp = /\.{3,}/g; | ||
alert( "Hello!... How goes?.....".match(regexp) ); // ..., ..... | ||
``` | ||
|
||
Please note that the dot is a special character, so we have to escape it and insert as `\.`. | ||
আমাদের মনে রাখা উচিত ডট একটি স্পেশাল ক্যারাক্টার, সুতরাং এটিকে আমাদের ব্যাকস্লাশের `\.` মাধ্যমে এস্কেপিং করে নিতে হবে। |
10 changes: 5 additions & 5 deletions
10
9-regular-expressions/09-regexp-quantifiers/1-find-text-manydots/task.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
importance: 5 | ||
গুরুত্বপূর্ন: ৫ | ||
|
||
--- | ||
|
||
# How to find an ellipsis "..." ? | ||
# কিভাবে একটি উপবৃত্ত খুঁজে পাব "..." ? | ||
|
||
Create a regexp to find ellipsis: 3 (or more?) dots in a row. | ||
একটি রেগুলার এক্সপ্রেশন লিখুন যা: ৩ (অথবা ততোধিক?) ডটের উপবৃত্ত খুঁজবে। | ||
|
||
Check it: | ||
এটি দেখুন: | ||
|
||
```js | ||
let regexp = /your regexp/g; | ||
let regexp = /আপনার রেগুলার এক্সপ্রেশনটি লিখুন/g; | ||
alert( "Hello!... How goes?.....".match(regexp) ); // ..., ..... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
9-regular-expressions/09-regexp-quantifiers/2-find-html-colors-6hex/task.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Regexp for HTML colors | ||
# এইচটিএমএল কালারের জন্য রেগুলার এক্সপ্রেশন | ||
|
||
Create a regexp to search HTML-colors written as `#ABCDEF`: first `#` and then 6 hexadecimal characters. | ||
হেক্সাডেসিমেল এইচটিএমএল কালার `#ABCDEF`: প্রথমে `#` তারপর ৬ টি হেক্সাডেসিমেল ক্যারাক্টার খোঁজার জন্য একটি রেগুলার এক্সপ্রেশন লিখুন। | ||
|
||
An example of use: | ||
ব্যবহারযোগ্য একটি উদাহরণ: | ||
|
||
```js | ||
let regexp = /...your regexp.../ | ||
let regexp = /...আপনার রেগুলার এক্সপ্রেশনটি লিখুন.../ | ||
|
||
let str = "color:#121212; background-color:#AA00ef bad-colors:f#fddee #fd2 #12345678"; | ||
|
||
alert( str.match(regexp) ) // #121212,#AA00ef | ||
``` | ||
|
||
P.S. In this task we do not need other color formats like `#123` or `rgb(1,2,3)` etc. | ||
পুনশ্চ এই টাস্কে আমাদের `#123` বা `rgb(1,2,3)` ইত্যাদি কালার ফরমেটগুলোর প্রয়োজন নেই। |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters