Created
June 23, 2013 04:44
-
-
Save phx/5843833 to your computer and use it in GitHub Desktop.
(bsd sed): target 3 sections of regex pattern, and further target one specific section to copy to new line.
This file contains 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
#!/bin/bash | |
nl=$'\n'; cat "hello.txt" | sed -E "s/(<img.+src=\")(.+)(\".+)/\1\\$nl\2\\$nl\3/g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment