As other answers have pointed out, this is a complex regex that could be executed against large portions of the web page's source code. A possible workaround includes leveraging Browser's async powers using Promises or Web Workers to unfreeze the UI but I don't think you're interested in solving this problem specifically. It seems like you're trying to scrape web data so it wouldn't make a difference whether the UI is frozen during this process or not.
My suggestion is to divide to conquer this problem. Let's take each selector and address them individually.
script[type="application/json"]
This one seems to be pretty straightforward. You probably just need to grab its inner content and voila, you have a JSON.
div[class*="json"]
I believe this one is a non-standard way to specify the initial state for web pages. It would probably fall into the same parser as above. You probably just need to grab its inner text and try to parse it as JSON.
script[type="text/javascript"]
This is the trickiest part since we're not dealing with a JSON anymore but executable JavaScript which may contain JSON data or not. For this one, you could use a simplified regex but I'd go further and suggest something else.
You could inspect JavaScript objects and try to convert them to JSON. This could be easily done with built-in API or using JavaScript parsers (like js2py if you're using something like Scrapy, for example). I'm not sure about the performance of this task but I believe it would be quicker than a complex regex and it might be worth a try.
It would work for cases like var initialState = { ... };
but maybe could present some challenges when trying to deal with inline values like hypedFramework.init({ ... })
. In the latter case, you would probably need some JavaScript parsing to isolate those values. But it's still possible. Take a quick look at https://esprima.org/demo/parse.html and see how it's able to extract Object Expressions from Function Arguments.