Fixing resource regex matching