Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-11-18 11:12
Flavor·PCRE (Legacy)

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

Description

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

let's fixed it.

Submitted by wangchaojs02