I was wondering if anybody could help with some RegEx validating.
I have a text box where a user is to input a set of XY coordinates e.g. 123.345, 543.123
I can use the following bit of RegEx to check for a single X or Y coordinate.
var pattern = "^[0-9]+[.]?[0-9]*$"; Allows only numbers and 1 decimal point to be entered.
But I can’t figure out how to allow the user to enter a single whitespace and/or a comma after the X coordinate and then continue to enter the Y coordinate.
I know this would be easier with two different textboxes but because of the application and UI requirements I cannot add a second text box for the Y coordinate.
Thanks for any help!
Try this :
Explanation :
Nota :
If you expect only a single space change
,\sinto,[ ].