How best to obtain NFL Name from String

Hello, what is best approach for me to capture just the NFL name from this string?
“New England Patriots 2021-2022”

What I need is this: “New England Patriots”


this sample would work with the following regex:

Probably you need more samples when the values will not be strict within this pattern


You can do as below to fetch the required value.

System.Text.RegularExpressions.Regex.Match(inputText, ([A-Z])\w+").ToString

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.