我试图用python在我的源文件中找到一些模式。这就是我的代码:
import os
import re
data=[]
pattern = re.compile('LocalizedString(.*)')
for dirname, dirnames, filenames in os.walk('.'):
for filename in filenames:
if '.m' in filename:
with open(os.path.join(dirname, filename),'r') as f:
for line in f:
matchObj = pattern.findall(line)
if matchObj:
for match in matchObj:
print "match : ", match
if '.git' in dirnames:
dirnames.remove('.git')
if '.svn' in dirnames:
dirnames.remove('.svn')
我想在源代码中获取LocalizedString()
调用的所有参数,例如:
在源代码中:
[_deleteButton setTitle:LocalizedString(@"Delete my Account") forState:UIControlStateNormal];
我想得到@"Delete my Account"
,但我得到了这个:
match : (@"Delete my Account") forState:UIControlStateNormal];