Reputation: 5623
Using these expressions separately, I can extract weight and price from this string, how can I get this to work in a single combined expression?
String:
0.280 Price $ 2.49
Expressions
(?<weight>\.?\d+(\x2E\d+))
(?<price>\d+\.\d+$)
Upvotes: 2
Views: 317
Reputation: 67968
(?<weight>\.?\d+(?:\x2E\d+)).*?(?<price>\d+\.\d+$)
Try this.See demo.
http://regex101.com/r/zR2tR4/21
Upvotes: 3