Regular Expressions 101

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?<name>[a-zA-Z0-9]*(?<!constructor)(?<!if)\s*)(?<arguments>\([^()\r]*\))(?<body>\s*{((?:[^{}](?!return))*(?:\g<body>)?)+})
/
gm

Description

This only seems to work in atom.

This regex only matches functions that don't return anything, as a part of a typescript migration.

Submitted by anonymous - 4 years ago