I am looking for a regex that allows decimal numbers and - only. I want the decimal to allow for two decimal places(.00). the regex I wrote only accepts decimals not -. any help on this would be great!
My regex code:
If Regex.IsMatch(node1("Comission").InnerText, "^[-]|\s\d{0,10}(\.\d{1,2})?$") = False Then
lstNodeErrs.Add(" invalid Comission: " & Comission)
End If
xml
<?xml version="1.0" encoding="us-ascii" standalone="yes"?>
<audit_xml>
<DataTable>
<Total_Debit_Amt>11.39</Total_Debit_Amt>
<Comission>11.39</Comission>
<Total_Taxes> </Total_Taxes>
<Tax_on_Commission_Amount> - </Tax_on_Commission_Amount>
</DataTable>
Example data: valid:
14
154542.75
.91
0.00
-
8.57
invalid:
12.1233
fhjfjfjh
ghghg.kk
note:comission can be decimal empty or -