UNIX/Linux: How to specify the beginning of a line or the ending of a line with anchors

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
702 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 20, 2011

The Beginning of Line anchor and the End of Line anchor are "^" and "$". I'm going to show you how to use these special charactors using regular expressions to look for a string/word/pattern that is in specific locations(Beginning/Ending of line).

Example:

grep ^Begin
grep END$
grep ^thewordURLookingforatbeginningoffline
grep the wordURLookingforattheENDoftheLine$

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more