ends-with will not work with compiled regex patterns because it internally appends a $ (end of text) character to the pattern. If the pattern is already compiled that causes an error. But starts-with and others will work, as they do not change the pattern internally.