We know how to match individual characters and tokens, but what about when we want to define our match by where in the file the match is located? This is were location match tokens such as
$ come in. These metacharacters allow us to define whether our match comes at the beginning of a line, the end of a line, or both. In this lesson, we use
grep to demonstrate the matching capability of this token, then learn a more practical example where we remove blank lines from a file using
sed in combination with our location-based regex.
Get the lesson files here!: