Most search engines can't run a regex across a whole document, and the ones that can scan every byte. StackGrep indexes your text so a pattern only reads the documents that could match, then checks them with a linear-time engine that no pattern can make run away.
curl -G https://stackgrep.com/api/collections/code/search \
-H "Authorization: Bearer $STACKGREP_KEY" \
--data-urlencode 'q=AKIA[0-9A-Z]{16}' -d regex=1
# and exactly how many there are
curl -G https://stackgrep.com/api/collections/code/count ... -d regex=1search_collection(query: "AKIA[0-9A-Z]{16}", regex: true)search_collection(query: "Total: [0-9]{2},[0-9]{3}(\.[0-9]{2})? EUR", regex: true)count_collection(query: " 5[0-9]{2} ", regex: true)RE2-style syntax: character classes, alternation, repetition, anchors and groups. No backreferences or lookarounds, which is what keeps every search linear-time.
We pull the literal pieces out of your pattern (AKIA, EUR, max_connections) and use the index to find only the documents containing them. Only those get the full regex.
No pattern can blow up: the engine runs in time proportional to the text it reads. Patterns with no literal part at all, like [0-9]+, have to read everything, so they're slower.
StackGrep Engine is onboarding teams from the waitlist. Bring your documents or your bucket.