Regex help needed

Hello,

I'd like to write a regex that transforms a German base form of a noun into one of its inflected forms, namely

I want to translate "Haus" to "H�user"

This is what I've got:

/^(.+)$/_Umlaut( $1 )_er/

where Umlaut( x ) is a function operating on the noun stem captured by $1 The function performs the following transformations on the noun stem to model the effect of a typical vowel change in the stem:

Replace last occurrence of vowel [x] according to (vowel change):

/au/�u/
/a/�/
/o/�/
/u/�/

Return the modified stem

However, this function doesn't work with "au", it only works for words like Topf -> T�pfe

In the case of "Haus", it wrongly outputs "H��ser", so it makes an Umlaut out of both vowels, which I don't want.

Any suggestions on how to tell the function how to perform this step only on the first vowel are appreciated :slight_smile:

Thanks and kind regards,
Kat

See if the ^ (caret) works for you:

/au/�u/
/a[^u]/�/
/o/�/
/[^a]u/�/