Regex pattern problem in python
- by mridang
I need to extract parts of a string using regex in Python.
I'm good with basic regex but I'm terrible at lookarounds. I've shown two sample records below. The last big is always a currency field e.g. in the first one it is 4,76. In the second one it is 2,00. The second has an account number that is the pattern of \d{6}-\d{6}. Anything after that is the currency.
24.02 24.02VALINTATALO MEGAHERTSI4,76-
24.02 24.02DOE MRIDANG 157235-1234582,00-
Could you help me out with this regex? What I've written so far is given below but it considers everything after the 'dash' in the account number to be the currency.
.*?(\d\d\.\d\d)(.*?)\s*(?<!\d{6}-\d{6})(\d*,\d\d)
Thanks in advance