Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • \$\begingroup\$ is there a difference between [1-9]|0 and [0-9] or \d?? \$\endgroup\$ Commented Aug 11, 2016 at 15:34
  • \$\begingroup\$ @apsillers Ah yes, an earlier version of my code could generate a trailing . which would throw the test, but I think this version is OK. \$\endgroup\$ Commented Aug 11, 2016 at 15:36
  • \$\begingroup\$ @YOU The important bit is that the 0 has a $. (It's also missing a ^, so thanks for drawing my attention to it.) \$\endgroup\$ Commented Aug 11, 2016 at 15:38
  • \$\begingroup\$ @apsillers Sadly splice doesn't work like that, it modifies the array and returns any removed elements. \$\endgroup\$ Commented Aug 11, 2016 at 15:47