Created
June 23, 2017 05:34
-
-
Save ch4/e4dce7313c9a42df665155c23bed255b to your computer and use it in GitHub Desktop.
sed regex capture group example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "/junk1/harvey/junk2/test.jpg" | sed "s/^.*\/junk1\/\(\S*\)\/junk2.*$/\1/" | |
# prints "harvey" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment