I was trying to match this pattern in regex 101
<a href="http://google.com">Google.com</a>
<A target="_blank" href='http://example.com/files.html'>An Example</A>
<a id="link23" HREF = "file23.html" target="_TOP">File #23</a>
<a href="images/mypic.png">See my picture!</a>
<a href="mailto:joelross@uw.edu">Email Joel</a>
and I made this regex- <[aA].\s(HREF|href)\s?=\s?('|").('|")>.*</[aA]>
now when I am trying to use the grep command via my command line,it throws me an error.
./mdlinks.sh: line 3: unexpected EOF while looking for matching `"'
./mdlinks.sh: line 4: syntax error: unexpected end of file
Here is the source file
#! /usr/bin/env bash
CONTENT=$(curl $1)
echo "$CONTENT" | grep -E -o '<[aA].*\s(HREF|href)\s?=\s?('|").*('|")>.*<\/[aA]>' >> mdlinks.txt