Skip to content

Instantly share code, notes, and snippets.

@nskeip
Created August 4, 2013 06:46
Show Gist options
  • Save nskeip/6149465 to your computer and use it in GitHub Desktop.
Save nskeip/6149465 to your computer and use it in GitHub Desktop.
Shows all the links from stdin
#!/usr/bin/perl
#
$text = <>;
@links = $text =~ m/href=\"([^\"]+)/g;
print join ("\n", @links), "\n";
@nskeip
Copy link
Author

nskeip commented Aug 4, 2013

Using regex for html parsing does not seem to be a good idea.
But at least it worked for me when I did not know lxml or beautiful soup or something... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment