Skip to content

Commit 99cc197

Browse files
committed
Task 1
1 parent e062fd0 commit 99cc197

File tree

2 files changed

+11
-11
lines changed
  • 9-regular-expressions/14-regexp-lookahead-lookbehind/1-find-non-negative-integers

2 files changed

+11
-11
lines changed

9-regular-expressions/14-regexp-lookahead-lookbehind/1-find-non-negative-integers/solution.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

2-
The regexp for an integer number is `pattern:\d+`.
2+
পূর্ণসংখ্যার রেগুলার এক্সপ্রেশন হল `pattern:\d+`
33

4-
We can exclude negatives by prepending it with the negative lookahead: `pattern:(?<!-)\d+`.
4+
আমরা ঋণাত্নক সংখ্যাগুলোকে বাদ দিতে পারি নেগেটিভ লুকবিহাইন্ড এর মাধ্যমে: `pattern:(?<!-)\d+`
55

6-
Although, if we try it now, we may notice one more "extra" result:
6+
সম্ভবত, আমরা এটি চেষ্টা করতে পারি, তবে এক্ষেত্রে আমরা "অতিরিক্ত" ফলাফল পাব:
77

88
```js run
99
let regexp = /(?<!-)\d+/g;
@@ -13,11 +13,11 @@ let str = "0 12 -5 123 -18";
1313
console.log( str.match(regexp) ); // 0, 12, 123, *!*8*/!*
1414
```
1515

16-
As you can see, it matches `match:8`, from `subject:-18`. To exclude it, we need to ensure that the regexp starts matching a number not from the middle of another (non-matching) number.
16+
এখানে দেখতে পাচ্ছি, `subject:-18` এর মিল `match:8`। এটিকে বাদ দিতে হলে, আমাদের নিশ্চিত হতে হবে রেগুলার এক্সপ্রেশনটি অন্য সংখ্যার মাঝে যাচাই করবে না।
1717

18-
We can do it by specifying another negative lookbehind: `pattern:(?<!-)(?<!\d)\d+`. Now `pattern:(?<!\d)` ensures that a match does not start after another digit, just what we need.
18+
এজন্য আমরা আরো একটি লুকবিহাইন্ড ব্যবহার করতে পারি: `pattern:(?<!-)(?<!\d)\d+`। এখন `pattern:(?<!\d)` এর দ্বারা নিশ্চিত করছি কোন ম্যাচ অন্য ডিজিটের মাঝ থেকে যাচাই করবে না।
1919

20-
We can also join them into a single lookbehind here:
20+
আমরা একে একটি লুকবিহাইন্ডে সংযোগ করতে পারি:
2121

2222
```js run
2323
let regexp = /(?<![-\d])\d+/g;

9-regular-expressions/14-regexp-lookahead-lookbehind/1-find-non-negative-integers/task.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Find non-negative integers
1+
# অঋণাত্নক পূর্ণসংখ্যার অনুসন্ধান
22

3-
There's a string of integer numbers.
3+
এখানে পূর্ণসংখ্যার একটি স্ট্রিং আছে।
44

5-
Create a regexp that looks for only non-negative ones (zero is allowed).
5+
একটি রেগুলার এক্সপ্রেশন লিখুন যা অঋণাত্নক পূর্ণসংখ্যার অনুসন্ধান করে (শূন্যও অনুসন্ধান করবে)।
66

7-
An example of use:
7+
উদাহরণ:
88
```js
9-
let regexp = /your regexp/g;
9+
let regexp = /আপনার প্যাটার্ন/g;
1010

1111
let str = "0 12 -5 123 -18";
1212

0 commit comments

Comments
 (0)