Can anybody help to create a regex to handle this sutuation.
There is a display format string for numerics values, which can be in following format
positive_value_format;negative_value_format.
Positive and negative formats can be for example ‘#,##0.00;(#,##0.0000)’ or ‘#,##0;(#,##0.0)’ or ‘#,##0’ – it means that one positive value should be shown with 2 digits after the dot, another – with no digits.
so I need to create regex to handle this 3 cases, what is the number of decimal places for positive and\or negative values.
‘#,##0.00;(#,##0.0000)’ -> 2, 4
‘#,##0;(#,##0.0)’ -> 0, 1
‘#,##0’ -> 0
I’ve found following questions, but they are not answered or use parsing strings instead of RegExp – What would be a good way of determining number of decimal places from a format string?, identify the number of decimal places based on the format string
This works with all 3 provided strings