Using sed to extract a substring in curly brackets
bash, sed
Solution
To get the values which was between `{`, `}`
$ sed 's/^[^{]*{\([^{}]*\)}.*/\1/' file
Wed Nov 19 14:17:32 2014
Problem
I've currently got a string as below: ``` integration@{Wed Nov 19 14:17:32 2014} branch: thebranch ``` This is contained in a file, and I parse the string. However I want the value between the brackets `{Wed Nov 19 14:17:32 2014}` I have zero experience with Sed, and to be honest I find it a little cryptic. So far I've managed to use the following command, however the output is still the entire string. What am I doing wrong? ``` sed -e 's/[^/{]*"\([^/}]*\).*/\1/' ```