Created
July 24, 2014 09:25
-
-
Save orodley/c3adb0bd7cacd4491ad1 to your computer and use it in GitHub Desktop.
Extract base64-encoded images from an HTML file.
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
for image in `grep --color=never -Po 'data:image/[^;]*;base64,\K[a-zA-Z0-9+/]*' foo.html`; do echo -n "$image" | base64 -di > `mktemp image_XXXX`; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think your matching group should read
[a-zA-Z0-9+/=]
to catch padding characters.