I would like to know the regex for splitting up the decimal number from a string say
str = "COD Amount = 333.98"
in the above string value I just need only the decimal values ie 333.98.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s mandatory to use regex? If it’s not then you can use:
Hope it helps.
EDIT
With regex:
But make sure that all your strings are in the same format: [code] [description] = [number]
(I’m still thinking that the first solution is most appropriate)
EDIT 2
Since your input is like this:
"COD Amount = 333.98, Coverage = $564.000"(you should provide us the entire format of your lines in the original question)you can combine the two previous solutions:
}