Maybe a regex pattern is better:
 pattern = re.compile("\[ci(\s+)rebuild\]", re.I)