How can I use a single regular expression to replace all words town
with village
preserving the case of the first letter of each match?
Example input:
Towns are small cities. I live in a town.
Desired output:
Villages are small cities. I live in a village.