Home / Regex search over website source code
Guide
Regex search over website source code
By the SearchWebCode team · Published December 9, 2025 · Regex · 2 min read
/pattern/. Keep a literal fragment of at least three characters in it (like UA-) so the pre-filter stays fast, then let the regex handle the variable part.Reach for regex when the thing you're hunting has a shape rather than a fixed value: an ID with a variable number, a CDN path with a version in it, a config key whose value changes per site. Wrap the pattern in slashes and SearchWebCode runs it against the raw source.
A speed rule first
The engine pre-filters candidates on literal 3+ character substrings, then verifies with your full regex. So anchor every pattern on a fixed fragment. /UA-[0-9]{4,}-[0-9]/ is fast because UA- narrows the field; a pattern that starts with /[a-z]+/ has nothing to pre-filter on and scans far more. Give it a literal handle.
Patterns that earn their keep
- Legacy Analytics IDs:
/UA-[0-9]{4,}-[0-9]/, every Universal Analytics property by shape. - AdSense publisher IDs:
/ca-pub-[0-9]{10,}/, link sites to one Google Ads publisher account. - Meta Pixel inits:
/fbq\(.init., .[0-9]{6,}/, any Facebook pixel initialization. - Versioned libraries:
/jquery-3\.[0-9]+\.[0-9]+/, pin down which jQuery 3.x builds are in the wild.
Literal vs regex
If you know the exact value, search it literally, it's faster and needs no escaping. Use regex only for the variable part. For a full operator list including how regex composes with boolean AND/OR, see the syntax reference.
← All guides · Browse technologies
Frequently asked questions
How do I run a regex search?
Wrap the pattern in slashes, e.g. /UA-[0-9]{4,}-[0-9]/, or toggle regex in the search box. It runs against the raw HTML/CSS/JS source.
Why is my regex slow?
The engine pre-filters on literal 3+ character fragments. A pattern with no fixed substring (like /[0-9]+/) has nothing to narrow on and scans much more. Anchor it on a literal like UA- or ca-pub-.
Can I mix regex with AND/OR?
Yes, a /regex/ term can be one leaf of a boolean query, e.g. combined with a literal via a space (AND) or OR. See the syntax reference.