Search code examples
regexexpressionyacclex

Need number range in regular expression


I have question about regular expression. I need code with range from -1000 to 1000.

I know from 0 to 1000

([0-9]{1,3}|1000)

But i can not figure it with -1000 - 1000

I appreciate some help.

Thanks a lot!


Solution

  • What about this?

    (-?1000|-?\d{1,3})