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