import rerx = r"(.*?)(\d+(?:[.]\d+)?)"ss = ["CA$1.90", "RM1"]for s in ss: print(re.findall(rx, s))
Standard input is empty
[('CA$', '1.90')] [('RM', '1')]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!