Would it really? I'd like to see some hard data on that.
"what incentive would Google have to run long-running regex processing tasks, without showing you any ads or gathering any useful info in the process?"
What incentive does Google have for allowing regexes to be used in searches of source code, which it already does?
It's useful, and it gets Google goodwill from its users. Plus, many of its own employees probably benefit from it.
The number of users of Google's regex code search feature is probably no greater than the number of people who'd use regexes in general search, perhaps even smaller.
As far as ads go, I'd bet the vast majority of people who use Google's code search engine run ad blockers and don't see any ads anyway. I very much doubt that Google gets much if any profit from running it. And yet they do it.