Hello. I have two simple questions about regular expressions.
Having the string "$10/$50", I want to get the 50, which will always be at the end of the string. So I made: ([\d]*$)
Having the string "50c/70c" I want to get the 70, which will always be at the end of the string(i want it without the c), so I made: ([\d]*)c$
Both seem do to what I want, but I actually would like to do 2 things with it:
- a) I'd like to put both on the same string(is it possible?). I tried with the | but it didn't seem to work.
- b)If indeed it is possible to do a), i'd like to know if it's possible to format the text. As you can see, both for dollars and cents, I will retrieve with the regular expression the value the string shows. But while in the first case we are dealing with dollars, in the second we're dealing with cents, so I'd like to transform 50 cents into 0,5. Is it possible, or will I have to code that by myself?
Thanks!