Due to the following regex, the browser crashes or waits for an indefinite time
The problem looks like due to catastrophic backtracking. Is there a way to improve this re