Skip to content

Instantly share code, notes, and snippets.

@johnhaitas
Last active December 12, 2015 01:39
Show Gist options
  • Save johnhaitas/4693189 to your computer and use it in GitHub Desktop.
Save johnhaitas/4693189 to your computer and use it in GitHub Desktop.
convert NSDictionary/NSMutableDictionary to literal syntax Xcode Find/Replace regex
[aDictionary objectForKey:@"Key"] -> aDictionary[@"Key"]
=========================================================
Find
\[(\w+) *objectForKey: *(@"\w+") *\]
Replace
\1\[\2\]
[aDictionary setObject:object forKey:@"Key"] -> aDictionary[@"Key"] = object
=============================================================================
Find:
\[(\w+) *setObject: *(\w+) *forKey: *(@"\w+") *\]
Replace:
\1\[\3\] = \2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment