I want to extract net profit from the statement, with 'net profit' as the non capturing part. Not sure how to do it(may be a non capturing look behind?)
eg
'business venture of net profit 23.5 million dollars'
required o/p:
23.5 million
Applied the following regex:
(net|nt)\s*\.?\s*(profit|earnings)\s*\.?\s*\d+\.?\d*\.?\s*(?:lakh|crore|million)
But, it is giving
[('net', 'profit')]
as the output.
remodule documentation and find the lookbehind assertion syntax ((?<=...)) yet? IIRC you can't use variable-width patterns (*specifically) in an assertion like that however. Perhaps you just wanted t omake the groups non-capturing (like the group you put after)?ne?t\s*\.?\s*(?:profit|earnings)\s*(\.?\s*\d+\.?\d*\.?\s*(?:lakh|crore|million))