-
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 #199 from msisaifu/greedy-lazy-mode
Greedy and lazy quantifiers
- Loading branch information
Showing
7 changed files
with
127 additions
and
126 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
9-regular-expressions/10-regexp-greedy-and-lazy/1-lazy-greedy/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,6 +1,6 @@ | ||
|
||
The result is: `match:123 4`. | ||
ফলাফলটি হল: `match:123 4`। | ||
|
||
First the lazy `pattern:\d+?` tries to take as little digits as it can, but it has to reach the space, so it takes `match:123`. | ||
প্রথমে লেজি মোডে এই প্যাটার্নটি `pattern:\d+?` চেষ্টা করে যত কম সম্ভব অঙ্ক নেয়ার, কিন্তু প্যাটার্নের পরবর্তী স্পেস এর জন্য এটি স্পেস পর্যন্ত মেলে, সুতরাং এটি `match:123` এর সাথে মেলে। | ||
|
||
Then the second `\d+?` takes only one digit, because that's enough. | ||
অতঃপর পরবর্তী `\d+?` শুধু একটি অঙ্ক নেই, কেননা এরপর আর কোন প্যাটার্ন নেই। |
4 changes: 2 additions & 2 deletions
4
9-regular-expressions/10-regexp-greedy-and-lazy/1-lazy-greedy/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
6 changes: 3 additions & 3 deletions
6
9-regular-expressions/10-regexp-greedy-and-lazy/3-find-html-comments/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
8 changes: 4 additions & 4 deletions
8
9-regular-expressions/10-regexp-greedy-and-lazy/3-find-html-comments/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
2 changes: 1 addition & 1 deletion
2
...-expressions/10-regexp-greedy-and-lazy/4-find-html-tags-greedy-lazy/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,5 +1,5 @@ | ||
|
||
The solution is `pattern:<[^<>]+>`. | ||
সমাধানটি হল `pattern:<[^<>]+>`। | ||
|
||
```js run | ||
let regexp = /<[^<>]+>/g; | ||
|
10 changes: 5 additions & 5 deletions
10
...ular-expressions/10-regexp-greedy-and-lazy/4-find-html-tags-greedy-lazy/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 @@ | ||
# Find HTML tags | ||
# এইচটিএমএল ট্যাগের অনুসন্ধান | ||
|
||
Create a regular expression to find all (opening and closing) HTML tags with their attributes. | ||
একটি প্যাটার্ন লিখুন যেন সকল এইচটিএমএল ট্যাগগুলো(অ্যাট্রিবিউটসহ) খুঁজে পায়. | ||
|
||
An example of use: | ||
উদাহরণস্বরূপ: | ||
|
||
```js run | ||
let regexp = /your regexp/g; | ||
let regexp = /আপনার প্যাটার্ন/g; | ||
|
||
let str = '<> <a href="/"> <input type="radio" checked> <b>'; | ||
|
||
alert( str.match(regexp) ); // '<a href="/">', '<input type="radio" checked>', '<b>' | ||
``` | ||
|
||
Here we assume that tag attributes may not contain `<` and `>` (inside squotes too), that simplifies things a bit. | ||
এখানে কিছুটা সহজের জন্য আমরা ধরে নিয়েছি অ্যাট্রিবিউটের মাঝে এই দুটি বন্ধনী `<` এবং `>` থাকবে না। |
Oops, something went wrong.