@staticmethod
def makePattern(regexFilter):
    """
        If regexFilter doesn't already have them, add ^ to the beginning and $
        to the end since these are required by NdnRegexTopMatcher.

        :param str regexFilter: The regex filter.
        :return: The regex pattern with ^ and $.
        :rtype str:
        """
    pattern = regexFilter
    if not (len(pattern) >= 1 and pattern[0] == '^'):
        pattern = '^' + pattern
    if not (len(pattern) >= 1 and pattern[-1] == '$'):
        pattern = pattern + '$'
    return pattern
