I have a text file this way
"an arbitrary string" = "this is the text one"
"other arbitrary string" = "second text"
"a third arbitrary string" = "the text number three"
I want to obtain only this
an arbitrary string
other arbitrary string
a third arbitrary string
That is, the text inside the first quotes, or between the first "
and the " =
. I used this regex
(?!").*(?=(" =))
This is working when I tried it in RegExr and in this online tool. But in my OSX Terminal it does not work, the output is empty
grep -o '(?!").*(?=(" =))' input.txt
What is wrong here? Do I have to escape some characters? I try everyone and nothing changes.
Thank you so much and please excuse my lack of knowledge about this topic.