This is a regular expression problem, rather than a Python problem.
Do you have evidence for this assertion, except that other regex implementations have this limitation?
For my use case, it unfortunately can't.
For that case, Ram, I've already given my best advice. If you get a better idea, please do follow it. And share it with us, so we can all learn. -- Jonathan