final cleanup regexps

This commit is contained in:
Ilya Kantor 2015-04-07 15:22:06 +03:00
parent 59388d093e
commit 833f7ba70e
132 changed files with 410 additions and 183 deletions

View file

@ -0,0 +1,13 @@
Целое число с необязательной дробной частью -- это <code class="pattern">\d+(\.\d+)?</code>.
К этому нужно добавить необязательный `-` в начале:
```js
//+ run
var re = /-?\d+(\.\d+)?/g
var str = "-1.5 0 2 -123.4.";
alert( str.match(re) ); // -1.5, 0, 2, -123.4
```