How to get the first word in the string February 2, 2023 by Tarik Regex is unnecessary for this. Just use some_string.split(' ', 1)[0] or some_string.partition(' ')[0].