Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?:(\bpublic\b)\s|(\bprivate\b)\s|(\babstract|partial|sealed\b)\s|(\bclass\b)\s(\b\w+\b)(?:\(.*\)))
/
g

Description

This regex will match the class definition withing the cs file

Submitted by Gabriel Marius Popescu - 7 years ago