As a follow up to a previous question about lazy matching using grep
, I have a similar question about sed
:
Suppose I have the following text file (called test.txt
):
\centerline{\includegraphics[width=0.50 \columnwidth]{example_graph.pdf}}
\centerline{\includegraphics[width=0.5 \columnwidth]{coarse_grain_illustration.png}}
\centerline{\includegraphics[width= 0.8 \columnwidth]{1y26_energy_dists.pdf}}
If I run:
$ sed -r 's/\\includegraphics.*?}//g' test.txt
\centerline{
\centerline{
\centerline{
Then it matches all the way to the last curly bracket. Should it not match just to the first?
No comments:
Post a Comment