Home > Enterprise >  Regex with sign
Regex with sign

Time:10-11

I need a simple regex for numbers only [0-9] but it must be a number with length 19 and can have optional "-" sign:

Correct Example:

-1234567890123456789

Correct Example 2:

1234567890123456789

Any idea how to start?

CodePudding user response:

This should work for you.

-?\d{19}

It has an optional "-" sign and then 19 digits.

  • Related