Re-added regex for patterns not ending in $ and return on match failure.