I am trying to convert a word to syllable using regular expression. What is the regular expression for converting. I found it for Indonesian language:
[^aeiou]?[aeiou]((ng|[^aeiou])(?![aeiou]))?
I am trying to convert a word to syllable using regular expression. What is the regular expression for converting. I found it for Indonesian language:
[^aeiou]?[aeiou]((ng|[^aeiou])(?![aeiou]))?
English is famously irregular - you simply cannot discern the pronunciation of a word from its spelling. Certainly no regex will come close to doing what you want.
(If you were to have a reasonable crack at this you'd need to have a set of rules of how to tokenise a word into syllables, as well as a (large) list of exceptions and special cases. This is definitely not possible with a regular language, and would be very challenging to do as a full-blown program.)