Why does this regex gives false for "0"

regex = ([+-]?(\d+\.\d+|\d+\.|\.\d+)|[+-]?\d+)([eE][+-]?\d+)?

This works for 0 on regexr.com but not in leetcode's js compiler

Comments (0)