Pattern library/HTML meta description regex
HTML meta description regex
Useful when scraping SEO snippets from listing pages. Prefer matching the content value only.
Open Forge to tighten quote styles or swap to og:description variants.
Expression
/(?<=name\s*=\s*['"]description['"][^>]*content\s*=\s*['"])[^'"]+/i
How to read it
(?<=name\s*=\s*['"]description['"][^>]*content\s*=\s*['"])After description meta's content quote[^'"]+Full match is the description text
Sample test
2 match(es)<meta name="description" content="Ship regex faster." /> <meta name='description' content='Alternate quotes work too.' /> <meta name="viewport" content="width=device-width" />
Starter prompt: extract meta description content from HTML