<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def analyse_text(text):
 """ Check if code contains REBOL header and so it probably not R code """

        if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE):
            # The code starts with REBOL header
            return 1.0
        elif re.search(r'\s*REBOL\s*[', text, re.IGNORECASE):
            # The code contains REBOL header but also some text before it
            return 0.5