I have a file that has to be tailored; It contains "variables" that are represented by @variable.name@; There may be more than one such variable on a line; and I want to find all of them.
My thought is that this should be possible with a sed regex, but most linux commands are at my disposal...
The regex I thought of was this one:
s#(.*)(@.*@)(.*)#\2#
However, that did not catch all...
Lets assume this file:
Dear @sirmadam@,
Today is @day@-@month@-@year@, a nice @weekday@day.
It is my @pleasureornot@ to tell you youre @hiredorsacked@.
Sincerely,
@nameoftheboss@
The output should be:
@sirmadam@
@day@
@month@
@year@
@weekday@
@pleasureornot@
@hiredorsacked@
@nameoftheboss@
I think my main issue is that the start and end of each variable uses the same sign, but there is little I can do about that... My regex-fu is lacking... I cant wrap my head around how this could be solved, it is a bit of a puzzle for me.