#in a loop s/[A-Z]+/REPLACE/, next; s/[a-z]+/replace/, next; s/[A-Z][a-z]+/Replace/, next;