Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?<!animations|foreach|completion|block|dispatch|configuration|mas_makeConstraints|dispatchUI):\s*(\^(?!\))[^{;]*\{\s+(?!\s*@strongify\(self)[^{}]*?\b(?:self|_)(?!\s+class))
/
gm

Description

in os development such code caused memory leak, [some do:^(){ self.someProperty = value; }];

let's fixed it.

Submitted by wangchaojs02 - 9 years ago