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
Post a Comment