Regular Expressions 101

Regex to match positive or negative number or empty string, but not '-' alone

Open Workspace
  • JavaScript
  • Match
0

Regular Expression

/
^(|-?\d+)$
/
g

Description

No description provided.

Submitted by myth