python regex get string before character

You don't need regex for this

>>> s = "Username: How are you today?"
You can use the split method to split the string on the ':' character

>>> s.split(':')
['Username', ' How are you today?']

Here is what the above code is Doing:
1. We create a string, s, with the value “Username: How are you today?”
2. We call the split method on the string, s, passing in the ‘:’ character as an argument. This tells the split method to split the string on the ‘:’ character.
3. The split method returns a list with two elements. The first element is the part of the string before the ‘:’ character, and the second element is the part of the string after the ‘:’ character.