I have a string in a file a.txt
{moslate}alho{/moslate}otra{moslate}a{/moslate}
a need to get the string otra
using sed.
With this regex
sed 's|{moslate}.*{/moslate}||g' a.txt
a get no output at all but when i add a ?
to the regex
s|{moslate}.*?{/moslate}||g a.txt
(I've read somewhere that it makes the regex non-greedy) i get no match at all, i mean a get the following output
{moslate}alho{/moslate}otra{moslate}a{/moslate}
How can i get the required output using sed?