Answer by Sergei B. for Regular expression - only digits, dots,commas and...
Why not to use common approach for formatting and use appropriate IFormatProvider? Have no idea why do you need regex here... public static string GetFormattedCurrency(decimal value) { var formatInfo =...
View ArticleAnswer by stema for Regular expression - only digits, dots,commas and first...
Try this^\$?\d{1,3}(?:,\d{3})*(?:\.\d{1,2})?$See it here online on RegexrThe $ at the start is optional. The 1 to 3 digits, then can be groups of 3 digits separated by commas, at last an optional 1 or...
View ArticleAnswer by NobodysNightmare for Regular expression - only digits, dots,commas...
My proposal (untested):\$(\d{1,3})(,\d{3})*(\.\d+)?we require a dollar, followed by a up to 3 digits.then there might come more exactly 3-digit long groups.at the end there might be a comma followed by...
View ArticleAnswer by ojlovecd for Regular expression - only digits, dots,commas and...
try this:^\$\d{1,3}(,\d{1,3})*(\.\d+)?$
View ArticleAnswer by GeirGrusom for Regular expression - only digits, dots,commas and...
\$(\d{1,3},)*(\d{1,3})(\.\d+)?
View ArticleAnswer by Developer for Regular expression - only digits, dots,commas and...
How about this[$]?(?:\d\,?){0,}(?:\.\d*)?
View ArticleRegular expression - only digits, dots,commas and first character should be $
I would like to have a regex for the following expression$123,456,789$1.23$123what i have done so far is if use enter 123456789 i will convert this to dollar format as follows $123,456,789.00But i...
View Article