Fix regular expressions in resource loader definitions

The first two commits are from #3, so please ignore them and merge in the correct order.