Question: I have a file containing lines with one word in upper case and one other word in lower case like this :

```
"BAMBARA"{ "bambara" }

```

As output I want to have :

```
case(BAMBARA) { template("bambara") }.

```

So far I have `sed/"$"/case($)/`
But it doesn't work at all. How can I do these specifying upper and lower case letters ?

Answer: 
a simple [sed](/questions/tagged/sed "show questions tagged 'sed'") would be

```
sed 's/\([a-z]\+\)/template(\1)/;s/"\([A-Z]\+\)"/case(\1) /'

```

notice that the order is important. If you invert it, you would match the word `case` as it is fully downcased.
```
$ sed 's/"\([^"]*\)"\(.*\)\("[^"]*"\)/case(\1) \2template(\3)/' file
case(BAMBARA) { template("bambara") }

```