I'm trying to capitalise some file names and also apply some exceptions to it. I have a series of substitutions, of which one is
s/\b(vs|etc)[.]?\b/\L$1./gir
With this I want to match any occurrence of "vs" or "Vs" or "vs." or "VS." or "etc." or "Etc" and so on. If the source string already has a full stop (eg. "Vs.") then I don't want to add one, otherwise I do want to add one. The resulting part of the string also needs to be lowercased, so that the only valid outputs are vs.
or etc.
.
It's probably just a trivial change, but I just can't find it. Can someone let me in on the thought process to assemble the regex, please?