# Capitalizing last word

**URL:** https://community.mp3tag.de/t/capitalizing-last-word/4715
**Category:** Support
**Created:** [April 6, 2007, 2:53pm UTC](https://community.mp3tag.de/t/capitalizing-last-word/4715 "2007-04-06T14:53:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Cookie\_Monster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cookie_monster/32/7_2.png) [@Cookie\_Monster](https://community.mp3tag.de/u/Cookie_Monster)
#### Post date: [April 6, 2007, 2:53pm UTC](https://community.mp3tag.de/t/capitalizing-last-word/4715/1 "2007-04-06T14:53:11Z")

</div>

I want to write an action that capitalizes song titles according to these rules:

[http://aitech.ac.jp/~ckelly/midi/help/caps.html](http://aitech.ac.jp/~ckelly/midi/help/caps.html)

It's not very advanced yet... but I had to think of a first potential problem already.

First I use $caps2, then I use simple matches "A"-\>"a", "The"-\>"the" and so on... but when the last word in a string is one of those matched words, how do I make sure it is capitalized at the end of the script again?

For the first letter of the string I can simply use "(^.)"-\>"$upper($1)", but there seems to be no way to match a whole word or is there? Match the string between the last whitespace and end-of-line ($)? But how do I do that?

**EDIT: I've found it: "\b\w\*$"**

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [April 6, 2007, 4:05pm UTC](https://community.mp3tag.de/t/capitalizing-last-word/4715/2 "2007-04-06T16:05:33Z")

</div>

I'm just curious: Do you know if such rules exist for the german language too?

---

<div class="post-metadata">

### Author: ![Cookie\_Monster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cookie_monster/32/7_2.png) [@Cookie\_Monster](https://community.mp3tag.de/u/Cookie_Monster)
#### Post date: [April 7, 2007, 3:00pm UTC](https://community.mp3tag.de/t/capitalizing-last-word/4715/3 "2007-04-07T15:00:09Z")

</div>

Yes, I'm sure but I don't know where to find them on the net. ☹

It's not as easy to implement such rules anyway. For example I can't write a regular expression that is able to distinguish between nouns, verbs, prepositions and so on... 😉

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:20pm UTC](https://community.mp3tag.de/t/capitalizing-last-word/4715/4 "2026-02-09T12:20:14Z")

</div>


