Say i have a list of sentences, many of which contain numbers (but not all):
mylist = [
"The current year is 2015 AD.",
"I have 2 dogs."
...
]
I want to know which elements in the list contain a valid year (say, between 1000 and 3000). I know this is a regex issue, and i have found a few posts (e.g., this one) that address detecting digits in strings, but nothing on full years. Any regex wizards out there?