Ash Framework: Hard to read regex (page 48)

The regex on page 48 is hard to read:

~r/(^https:\/\/|\/images\/).+(\.png|\.jpg)$/

It can be improved by changing the delimiters which means that you don’t have to escape all the forward slashes. Like so:

~r"(^https://|/images/).+(\.png|\.jpg)$"

1 Like

Oh that’s a great idea! Thank you, we’ll do that :slight_smile: