Skip to content
Advertisement

Tag: python-re

Regex to extract usernames/names from a string

I have strings that includes names and sometime a username in a string followed by a datetime stamp: I want to extract the usernames from this string: I have tried different regex patterns the closest I came to extract was following: Using the following regex pattern: Answer You may get all text up to the first occurrence of -+digits+-: If

Advertisement