I don't understand your question.
Your "cow" has no trailing "s" and so can't be detected as by your description.
located anywhere within the file name and they can also be in lower or upper case and have an s at the end of each word- - -
I can only imagine you mean to detect "cow" or "cows" and replace that with a new string.
FROM:
cow goes moo.ext
Cows Go Moo.ext
Do the Cows Moo.ext
Here goes the cows.ext
TO:
Barnyard Animal goes moo.ext
Barnyard Animal Go Moo.ext
Do the Barnyard Animal Moo.ext
Here goes the Barnyard Animal.ext
RULE:
detect non-case sensitive Cow or Cows and replace with new string
USE:
RegEx(1)
Find: (.*)(c|C)ows*(.*)
Replace: \1Barnyard Animal\3
EXPLANATION:
(C|c) => find either upper OR lowercase "c"
ow => find literal "ow"
s* => find null-or-more "s" => match if "s" is there-or not.
Instead of (C|c) we can also use the regex "lower case" switch (?i):
Find: (?i)(.*)cows*(.*)
Replace: \1Barnyard Animal\2
Shawnny Canuck wrote:Hello,
I apologize if this question has been asked already but I searched the forums and cannot find an answer. I am trying to rename files based on keywords that can be located anywhere within the file name and they can also be in lower or upper case and have an s at the end of each word. For example,
Original Name:
cow goes moo or
Cows Go Moo
Basically, once they keyword is located (in this case cow or Cows) within the string I want the file name to be replaced with a completely new word.
Desired Name:
Barnyard Animal
I figured I can spend days trying to research this problem or I could ask one of you regular expression experts who can figure it out in mins. Sorry for my terrible example but the files I am working on are sensitive in nature so I cannot share the actual file names. Thanks in advance for your help.
.