Regular Expressions 101

Community Patterns

Expanded visual basic functions/subs

1

Regular Expression
PCRE (PHP <7.3)

/
(?:Public|Private|Friend) (?:Shared )?(?:Overloads |Overrides )?(?:Sub|Function) (?<func>.*?)\(.+?\)(?: Implements )?.*?End (?:Sub|Function)
/
gis

Description

I've been using this regex to get a list of expanded functions/subs (specifically the names of them from the 'func' capture group) from VB code that is used as input in a code converter for a project at work.

Submitted by Timothy Smith - 8 years ago