2

I am trying to create a custom RegularExpressionValidator to validate the current expression

number(0-99).number(100-1000)\number(0-99).number(100-1000) 

or

number(0-99).number(100-1000),number(0-99).number(100-1000)

I am trying to create this expression but it didn't work

^\-?\d+\.?\d+\(/|,)\-?\d+\.?\d+$

What's the correct expression?

Regards,

Shiplu Mokaddim
  • 56,364
  • 17
  • 141
  • 187

1 Answers1

1

If you mean you need to match a \ or a , in a regular expression, then this should work:

[\\,]

The \ character needs to be escaped (with another \).

Putting this into your example above gives (I think)

^\-?\d+\.?\d+[\\,]\-?\d+\.?\d+$
Graham Clark
  • 12,886
  • 8
  • 50
  • 82