I want to match a "Double, Double, Double, Double" string using regular expression(for check validation of BorderThickness in a WPF App)
I found many similar answers on the stackoverflow , But none of them not worked for me.
I found [0-9]{4},[0-9]{4}
on this page , but it doesn't work because I need - + , .
characters in the string.
This is my code:
private static readonly Regex _regex = new Regex("[0-9]{4},[0-9]{4}");
public static bool TextIsThickness(string text)
{
return !_regex.IsMatch(text);
}
Example input string:
-1.4,2.75,0,10
Note: This is not duplicate,I need 4 double numbers that are separated by commas not the same as "Regular expression for double number range validation"
Please tell me how can I do it?