I need to extract a field value from a JSON string using POSIX.2 extended regular expressions (
man 7 regex
In POSIX "basic" regular expressions, capture groups are expressed with
\(...\), so what you want is:
Note that you have to use
[^"]* to prevent the pattern from matching across multiple strings (POSIX regular expressions don't have non-greedy quantifiers).
In "extended" regular expressions, you don't need the backslashes. But you still need to use
[^"] instead of
. to keep from matching too much.