I have an example:
echo "@article{gjn2010jucs, Author = {Grzegorz J. Nalepa}, " | awk '{ sub(/@.*,/,""); print }'
Is it possible to write a regular expression that selects the shorter pattern?
@article{gjn2010jucs,
Instead of a long pattern?:
@article{gjn2010jucs, Author = {Grzegorz J. Nalepa},
I want to get this result:
Author = {Grzegorz J. Nalepa},
EDIT:
I have another example:
echo ",article{gjn2010jucs, Author = {Grzegorz J. Nalepa}, " | awk '{ sub(/,[^,]*,/,""); print }'
Is it possible to write a regular expression that selects the shorter pattern?
, Author = {Grzegorz J. Nalepa},
Instead of a long pattern?:
,article{gjn2010jucs, Author = {Grzegorz J. Nalepa},
I want to get this result:
,article{gjn2010jucs

Authorfollowing a comma and whitespace, followed by whitespace followed by=followed by whitespace followed by{followed by any non-}followed by}, although this requires (among other things) that you can't nest{}inside the= { ... }part. – jw013 Oct 1 '12 at 17:02