For validation, I need to see if a copyright line contains a 4-digit date. This would be a valid copyright:
Copyright 2005, Fox
However, this would not:
Copyright Fox
How could I use regular expressions to check if a string contains a four-digit date?
I would use…
Which means the word
copyrightfollowed by 1 or more non-word characters (\W+) followed by four digits (\d{4}) insensitive to case (i)