In Ruby \A and \z should be used to refer to the beginning and end of the input string. ^ and $ mean beginning/end of line. As a result:
irb(main):005:0> "a\nNaN".numeric?
=> 2
It looks like the OR condition should be in a group as well.
- is related to
-
MONGOID-4744 Audit tree for incorrect use of ^ and $ anchors, replace with \A \z as needed
- Closed
- related to
-
MONGOID-4742 String#numeric? can return values other than true & false
- Closed
- links to