Hacker News new | ask | show | jobs
by halostatue 816 days ago
You need to make your regex multi-line (`/^\d+$/m`), but that isn't the problem shown. Your query will be searching for `25\n`, not `25` despite your pre-check that it’s a good value.

The second line should always be no, which if you use `\A\d+\z`, it will be.

1 comments

Yep, makes sense, thanks!