"The file name is not valid" error when trying to use "Get Group from Matched Text"
Another way I debugged this issue was I changed what it was matching. E.g. instead of matching the URL, I decided to match the "Click here" to see what would happen:


Accepts URLs
Get contents of [URL]
Make HTML from [Contents of URL]

The HTML at this stage is something like this:

&lt;a href="http://www.example.com"&gt;Click here&lt;/a&gt;

Match &lt;a href="[^"]+"&gt;(Click here)&lt;/a&gt; in [HTML from Rich Text]
Get [Group At Index] [1] in [Matches]
Show [Text] in Quick Look


Sure enough, this worked. Quick Look showed me:


  Click here


This made it clear that there is something going on with text that happens to be in the format of a URL in Quick Look.

The Get Type (along with Quick Look right after it) was helpful in debugging and figuring out what the issue was.

There were a few non-obvious things going on here:


When testing as a shortcut, the type of the text before reaching Quick look was Rich text. When testing with the Text action, the type of the text before reaching Quick look was Text.
If Quick Look receives Text (even if it looks like a URL), it'll display the URL as plain text.
If Quick Look receives text that looks like a URL of type Rich text, then it will try to display the contents of the URL, as though it's a local file (or something like that). This will most likely result in the The file name is not valid error mentioned above.


The fix, then, is to force the contents to be converted into plain text by adding an extra step right before the Quick Look:


Accepts URLs
Get contents of [URL]
Make HTML from [Contents of URL]

The HTML at this stage is something like this:

&lt;a href="http://www.example.com"&gt;Click here&lt;/a&gt;

Match &lt;a href="([^"]+)"&gt;Click here&lt;/a&gt; in [HTML from Rich Text]
Get [Group At Index] [1] in [Matches]
Get text from [Text]
Show [Text] in Quick Look