I am trying to extract the price from a string, but unable to fully complete the logic.
My String: (2) 1,127.22 abcdfg sdkjf 20,200.01 abcdfg sdfkgj (2) 10.28
What I want to do is:
to find all "(2)" in the string and then extract the full price next to it.
My regex pattern is: "\d+(,\d{1,100})"
My pattern only finds 1,127, 20,200 10 in the big string and it also doesn't have the condition of checking if it is next to (2).
I want to get the full price: 1,127.22 and 10.28
EDIT:
Managed to get cents with the regex: \d+(,\d{1,100})(.\d\d?)