Writing a regex to detect a range of numbers? Why not just parse the string to integers instead

Weiyuan
Level Up Coding
Published in
6 min readApr 14, 2020

--

Parsing a string to integer vs. Regex matching numerical values, which one is a “better” option?

I pondered this question, as I was exploring options for a bucket based approach, to do ab-testing with Nginx.

--

--

Senior Engineering Manager, Ascenda Loyalty | Former Engineering Manager, Grab | Former Director of Engineering, ZilLearn | bit.ly/weiyuan