Essentially, I want to replace the u between the random character and the k to be an o. The output I should get from the substitution is dudok and rujok.
How can I do this in Perl? I'm very new to Perl so go easy on me.
This is what I have right now:
$text = "duduk, rujuk";
$_ = $text;
s/.uk/ok/g
print $_; #Output: duok, ruok Expected: dudok, rujok
EDIT: Forgot to mention that the last syllable is the only one that should be changed. Also, the random character is specifically supposed to be a random consonant, not just any random character.
I should mention that this is all based on Malay language rules for grapheme to phoneme conversion.