xcode - Got Error 'repetition-operator operand invalid' with negative look behind regex (?<!(Log\())@"[^"]+" -


i want find hardcoded strings in project except words starts log(.

using regex getting error mentioned above.

keywords='(?<!(log\())@"[^"]+"'  find "${srcroot}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename "($keywords).*\$ 

is there other alternative regex or script same result.

you might filter out don't want see:

xargs -0 grep -eh '@"[^"]+"' | grep -v 'log\(@"' 

if want stick regular expression:

xargs -0 perl -ne 'print "$argv: $_" if /(?<!log\()@".+?"/' 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -