Skip to content

Commit 0bb446f

Browse files
authored
Update solution.md
1 parent ce60cc2 commit 0bb446f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • 9-regular-expressions/09-regexp-groups/3-find-decimal-positive-numbers

9-regular-expressions/09-regexp-groups/3-find-decimal-positive-numbers/solution.md

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

2-
An non-negative integer number is `pattern:\d+`. We should exclude `0` as the first digit, as we don't need zero, but we can allow it in further digits.
2+
Регэксп для неотрицательного целого числа `pattern:\d+`. Мы должны исключить `0` в качестве первой цифры, так как нам не нужен ноль, но мы можем разрешить его появление в составе чисел.
33

4-
So that gives us `pattern:[1-9]\d*`.
4+
Нам позволит сделать это регэксп: `pattern:[1-9]\d*`.
55

6-
A decimal part is: `pattern:\.\d+`.
6+
Десятичная часть находится с помощью: `pattern:\.\d+`.
77

8-
Because the decimal part is optional, let's put it in parentheses with the quantifier `pattern:'?'`.
8+
Поскольку десятичная часть является необязательной, то давайте заключим ее в скобки с квантификатором `pattern:'?'`.
99

10-
Finally we have the regexp: `pattern:[1-9]\d*(\.\d+)?`:
10+
В итоге, мы получаем регэксп: `pattern:[1-9]\d*(\.\d+)?`:
1111

1212
```js run
1313
let reg = /[1-9]\d*(\.\d+)?/g;

0 commit comments

Comments
 (0)