13 lines
279 B
Markdown
13 lines
279 B
Markdown
# Find all numbers
|
|
|
|
Write a regexp that looks for all decimal numbers including integer ones, with the floating point and negative ones.
|
|
|
|
An example of use:
|
|
|
|
```js
|
|
let regexp = /your regexp/g;
|
|
|
|
let str = "-1.5 0 2 -123.4.";
|
|
|
|
alert( str.match(regexp) ); // -1.5, 0, 2, -123.4
|
|
```
|