2021年1月5日星期二

a Regex pattern to extract names from text column

I am learning data and I found a problem to extract pet names from a text using Regex. Here is an example of the raw data each line of these is a row in a column with the title 'text' and I want to extract the pet names from that text into another column with the title 'pet_name'

I want a pattern that could help me to do so

"Meet Yogi. He doesn't have any important dog meetings today he just enjoys looking his best at all times. 12/10 for dangerously dapper doggo"

"This is Noah. He can't believe someone made this mess. Got the vacuum out for you though. Offered to help clean pup. 12/10 super good boy"

"Say hello to Lassie. She's celebrating #PrideMonth by being a splendid mix of astute and adorable. Proudly supporting her owner. 13/10"

and different ways of introducing the name of the pet

the result I need to get the names of the pets "Yogi", "Noah", "Lassie" in pet_name column

https://stackoverflow.com/questions/65589862/a-regex-pattern-to-extract-names-from-text-column January 06, 2021 at 11:36AM

没有评论:

发表评论