I have created a database of cigarette and trading cards. Each set title has a year associated with it. For example, 1943
or 2011
. The year is always 4 characters long, but can be anywhere in the string.
Could someone please help me create a regex that will find the year in the string. I tried '/d{4}\b/'
but it is failing.
(19|20)[0-9][0-9]
This will read in only 1900 and 2000 ranged dates.
Try this one :
/\b\d{4}\b/
it will match 4 digits embeded with non-words
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With