'what is this for?'

def getRefs(self, text):

    pattern = re.compile('(?:(?<=^)|(?<=\\s))\\[(.+)\\]((?:http(?:s?):\\/\\/|\\/)\\S+)(?=\\s|$)', re.U)
    text = pattern.sub(self.refs, text)
    return text
