HomeLanguage-Specific
Language-Specific
Regex tailored for Python, JS, Go, etc.
26 Tools Available
JS Function
Matches JS function declarations.
/function\s+(\w+)\s*\(/
JS Arrow Func
Matches JS arrow functions.
/const\s+(\w+)\s*=\s*\(/
JS Variable
Matches JS variable declarations.
/(var|let|const)\s+(\w+)/
Python Function
Matches Python functions.
/def\s+(\w+)\s*\(/
Python Class
Matches Python classes.
/class\s+(\w+)/
Python Decorator
Matches Python decorators.
/@(\w+)/
Java Class
Matches Java class defs.
/public\s+class\s+(\w+)/
Java Method
Matches Java methods.
/(public|private|protected)\s+\w+\s+(\w+)\(/
PHP Variable
Matches PHP variables.
/\$(\w+)/
PHP Function
Matches PHP functions.
/function\s+(\w+)/
Go Function
Matches Go functions.
/func\s+(\w+)/
Go Struct
Matches Go structs.
/type\s+(\w+)\s+struct/
Rust Function
Matches Rust functions.
/fn\s+(\w+)/
Swift Variable
Matches Swift variables.
/var\s+(\w+)/
Kotlin Function
Matches Kotlin functions.
/fun\s+(\w+)/
Ruby Method
Matches Ruby methods.
/def\s+(\w+)/
Perl Subroutine
Matches Perl subs.
/sub\s+(\w+)/
C# Property
Matches C# properties.
/public\s+\w+\s+(\w+)\s*\{/
SQL Select
Matches SQL SELECT statements.
/SELECT\s+.*\s+FROM/
HTML Comment
Matches HTML comments.
/<!--[\s\S]*?-->/
CSS Rule
Matches CSS rules.
/([\.#]?\w+)\s*\{/
TypeScript Interface
Matches TS interfaces.
/interface\s+(\w+)/
YAML Property Key
Matches YAML keys (language context).
/^(\w+):/
Markdown Header
Matches Markdown headers.
/^#{1,6}\s+(.+)/
JSON Key
Matches JSON keys.
/"(\w+)":/
Swift Function
Matches Swift functions.
/func\s+(\w+)/