I have the following copyright information that needs to be updated with current year…
Copyright (C) A Company, Inc. :y, all rights reserved.
I want to replace :y with the current year. I’m trying to add the test for ‘:y’ to the copyright-regexp variable but haven’t been able to figure it out.
I was hoping to just add ‘|:y’ to the end of the regex, but it doesn’t work & actually breaks the year replacement…
(©|@copyright{}|[Cc]opyrights *:?s *(?:(C))?|[Cc]opyrights *:?s *©)s *(?:[^0-9n]*s *)?([1-9]([-0-9, ';/*%#nt]|s<|s>)*[0-9]+|:y)
The above is from customize-variable on copyright-regexp
Also for the final solution, can you provide the string that I would actually use in the EL file? with the additional escape characters. I would assume the above would look like in the lisp file…
"\(©\|@copyright{}\|[Cc]opyright\s *:?\s *\(?:(C)\)?
\|[Cc]opyright\s *:?\s *©\)
\s *\(?:[^0-9n]*\s *\)?
\([1-9]\([-0-9, ';/*%#nt]\|\s<\|\s>\)*[0-9]+\|:y\)"
Thanks
I tried
(©|@copyright{}|[Cc]opyrights *:?s *(?:(C))?|[Cc]opyrights *:?s *©)s *(?:[^0-9n]*s *)?([1-9]([-0-9, ';/*%#nt]|s<|s>)*[0-9]+|:y)
Mark Field is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.