14 lines
273 B
Markdown
14 lines
273 B
Markdown
# Find non-negative integers
|
|
|
|
There's a string of integer numbers.
|
|
|
|
Create a regexp that looks for only non-negative ones (zero is allowed).
|
|
|
|
An example of use:
|
|
```js
|
|
let regexp = /your regexp/g;
|
|
|
|
let str = "0 12 -5 123 -18";
|
|
|
|
alert( str.match(regexp) ); // 0, 12, 123
|
|
```
|