regex - Regular Expression search/replace help needed, Python -
I want a rule that if the last vowel (aeo) of the string is before a character ('t , 'K', 's', 'vaccine'), then a :
should be added immediately after the vowel.
So, if I have Python in string "orchestras"
I need a rule that will change it to "orchestra: s"
< / P>
Edit: The last letter in the string (T, K, S, TK)
< Pre>
re.sub (r) ([aiō]] (t | k | s | vaccine) ([^ ayuu] *) $ ", r" \ 1: \ 2 \ 3 "," orchestra ") Again You will not say that "Vibe (R" ([AiOU]) (T | K | S | TK) $ ", R" \ 1: \ 2 "," Orchestras ")
Can there be other dishes after T / C / S / T The first reggax allows for it unless there is no more tone, so it will turn "fast" into "fiest". If the term should end with T / K / S / TK, then use the second reggae, which will do nothing for "fist".
Comments
Post a Comment