This post is part of a series on Regular Expressions and their applications in the Shortcuts app.
Using regular expressions in shortcuts is pretty simple. The Match Text block will always treat the text to match as a regular expression, and the Replace Text block has an option to treat the text to replace as a regular expression.
In the above image, the Match Text block takes the directory contents list, which looks like this:
hugo-files/data/links/cars.json hugo-files/data/links/podcasts.json hugo-files/data/links/language.json hugo-files/data/links/apps.json hugo-files/data/links/security.json hugo-files/data/links/linux.json hugo-files/data/links/programming.json hugo-files/data/links/apple.json
And performs a match to grab just the file name without the file extension, using the regular expression I talked …