Regex for VS Code and IDE Search/Find className/class attributes

Capture HTML or JSX class-like attributes.

Section: JetBrains IDE Recipes

Find className/class attributes

regex
regex
\b(?:class|className)=["']([^"']+)["']
Explanation

Useful for CSS cleanup and component audits.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing JetBrains IDE Recipes
Capture ES import path
Find JavaScript/TypeScript imports and capture the module path.
OpenIn sheetregexsame section
Find numbered file suffixes
Capture numeric suffixes in filenames or keys.
OpenIn sheetregexsame section
Enable regex mode in search
Use regex search in VS Code find/replace.
Find simple `var` declarations
Find `var` declarations for modernization review.
Add commas to object properties
Find non-final object property lines missing a comma.
Find CommonJS require calls
Find CommonJS imports for migration to ESM.