Extract content between strings

Hello
i am stuck with this.
i have input which is as follows

/type/work      /works/OL10627594W      3       2019-04-24T16:46:21.351549      {"created": {"type": "/type/datetime", "value": "2009-12-11T03:18:17.488715"}, "title": "Tog the dog", "covers": [8562336], "last_modified": {"type": "/type/datetime", "value": "2019-04-24T16:46:21.351549"}, "latest_revision": 3, "key": "/works/OL10627594W", "auth

i want a linux command to extract content between
"title": "
and
",

so output should be
Tog the dog

I am trying

sed   's/"title": "\(.*\)",/\1/'

but didnt work.
can someone suggest a command for this?

thanks

How about (untested)

sed  's/^.*"title": "//; s/",.*$//'

?

1 Like

yes that works.
thank you

Two substitutions is best here.
You can do it with one substitution though, as you intended.

sed 's/.*"title": "\([^"]*\)",.*/\1/'

Leading and trailing. * cover all the line, so all is substituted.
The .* is greedy; use [^"]* to ensure the following ", is the first one, in case there are more ", following.