Grep: invalid repetition count
grep -e
does not recognize \d
as digits. It does not recognize non-greedy forms like .*?
. For the grep
portion of your command, try:
grep -e '"weather":[^[]*\[[^{]*{[^}]*"id": *[0-9]\{1,3\}'
Alternatively, it your grep
supports it (GNU), use the -P
option for perl-like regex and your original regex will work:
grep -P '"weather":.*?\[.*?\{.*?"id": ?\d{1,3}'