<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalise_string(string):
 """ Strips trailing whitespace from string, lowercases it and replaces spaces with underscores """

    string = (string.strip()).lower()
    return re.sub(r'\W+', '_', string)