RegEx for Beginners: Copy and Paste Patterns

October 22, 2026

RegEx (short for “regular expression”) is a short pattern that tells a tool which words or web addresses to look for. You don’t need to learn it: copy a pattern below, paste it in, and change the example words to yours.

How to Use a Pattern in 3 Steps

  1. In your tool, choose the RegEx option. It may be called “matches RegEx”, “regex” or “regular expression”.
  2. Click Copy under a pattern below, then paste it in.
  3. If the pattern has example words in it, change them to your own words. Leave the symbols around them as they are. In a list, put a | between each word.

Good to Know

  • Capital letters: some tools ignore capital letters and some don’t. If yours doesn’t, look for an “ignore case” option, or type the pattern with the same capitals as your text.
  • Web addresses: the patterns in the Websites table work on full web addresses, like https://www.zillow.com/homes/. The first three also work on just the website name, like zillow.com.
  • Two patterns need a feature some tools don’t have. “Has none of these words” and “Has two words, in any order” use a lookahead, the (?= or (?! part. Google Search Console and Looker Studio don’t support it, so those two patterns won’t work there.

Words

Words patterns
To find text that…Copy this patternFindsDoesn’t find
Starts with certain words^real estateReal Estate AgentTampa Real Estate
Ends with certain wordsagency$Real Estate AgencyAgency of Tampa
Has any word from a list\b(agent|agency|realtor|broker)\bMortgage brokerHome builder
Has none of these words^(?![\s\S]*\b(cheap|free)\b)Best homesFree home value
Has a whole word, not part of a longer word\bagent\bAgent: Jo SmithReal estate agents
Has a word, with or without an s on the end\bagents?\bTop agents in TampaReal estate agency
Has two words, in any order^(?=[\s\S]*real estate)(?=[\s\S]*agent)Agent for real estateInsurance agent
Has one word, then another later onreal estate[\s\S]*agentReal estate team and agentAgent for real estate

Numbers and Questions

Numbers and Questions patterns
To find text that…Copy this patternFindsDoesn’t find
Has a number anywhere\dTop 10 agentsReal estate agent
Starts with a number, like "10 Best…"^\d10 Best Agents in TampaTop 10 agents
Has a number from 2020 to 2029, like a year\b202\d\bBest agents of 2026Since 1999
Has a price (a $ sign, then a number)\$\dHomes from $250,000Save money
Is a question (has a question mark)\?What does an agent do? Duties explainedHow to pick an agent
Starts with a question word (how, what, is, can, do…)^(how|what|why|when|where|who|whose|which|can|could|should|would|will|do|does|did|is|are|was|were)\bIs Zillow accurateIsland homes

Websites

The first three patterns work in both URL and domain fields. The last four work only in URL fields, which hold the full address. Keep the \ before each dot.

Websites patterns
To find text that…Copy this patternFindsDoesn’t find
Matches one domain^([a-z]+://)?([^/?#]*\.)?zillow\.com([/?#:]|$)https://www.zillow.com/homes/https://www.myzillow.com/
Matches any domain from a list^([a-z]+://)?([^/?#]*\.)?(zillow\.com|realtor\.com|redfin\.com)([/?#:]|$)realtor.comtrulia.com
Matches a .gov or .edu domain^([a-z]+://)?[^/?#]*\.(gov|edu)([/?#:]|$)https://www.usf.edu/https://governor.com/
Has a folder in the URL, like /blog//blog([/?#]|$)https://example.com/blog/posthttps://example.com/blogs/
Is a home page URL^https?://[^/?#]+/?(\?utm_[^#]*)?(#.*)?$https://example.com/https://example.com/about
Is a PDF URL\.pdf([?#]|$)https://example.com/guide.pdfhttps://example.com/pdf-guide
Has utm_ tracking in the URL[?&]utm_https://example.com/?utm_source=googlehttps://example.com/utm-guide

One Tip: Words With Symbols in Them

If your words have any of these symbols in them, put a backslash (\) in front of each one: . * + ? ^ $ ( ) [ ] { } | \

For example, St. Pete becomes St\. Pete.

Dani Owens Avatar

Dani Owens

Local SEO Consultant

From enterprise sites to scrappy local businesses, Dani has been living and breathing SEO since 2011. She works across the full SEO spectrum — technical, on-page, and off-page — with deep experience in audits, strategy, and hands-on implementation. Along the way, she’s written guest posts, spoken on webinars, and been featured by Semrush, BrightLocal, Whitespark, Moz, and Rio SEO, with her work cited and shared by industry heavyweights like Eric Ward, Darren Shaw, Phil Rozek, Marie Haynes, and David Mihm.

She previously served on the board of BayAreaSearch.org and built a local SEO training community that was acquired by Semrush in 2023. Today, Dani blends local content, high-quality backlinks, and targeted brand mentions to maximize Local PR impact for SEO and LLM visibility alike.

Fact Checked & Editorial Guidelines
Reviewed by: Subject Matter Experts