Decode a Rövarspråket string

Retina, 19 + 2 = 21 bytes

Retina strikes again! The code for this program consists of two files:

i`([b-z-[eiou]])o.
$1

This reads the input on STDIN and prints the output to STDOUT.

If you call the files pattern.rgx and replacement.rpl, you can run the program simply like

echo "hohelollolo" | ./Retina pattern.rgx replacement.rpl

Explanation

As for the previous answer, if Retina is invoked with 2 files it is automatically assumed to operate in "Replace mode", where the first file is the regex and the second file is the pattern.

Retina can be configured (which includes RegexOptions and other options) by prepending the regex with ` and a configuration string. In this case I'm only giving it i which is the normal regex modifier for case insensitivity.

The pattern itself is a bit more interesting this time. It still uses .NET's character class subtraction to match any consonant in the ASCII range, but then it also matches the following o as well as the character after it (i.e. the copy of the consonant). The replacement then just writes the captured consonant back.

You might be wondering why this is not ambiguous in a case like lololol -> lol. The trick is that matches cannot overlap and are always found from left-to-right. So whenever I encounter a consonant, I include the next two character in the match and replace all of them - the search continues after this. It's quite easy to convince yourself that this kind of greedy algorithm will always decode the input correctly. In fact the pattern could even have been

i`([b-z-[eiou]])..

Julia, 61 43 bytes

t->replace(t,r"(?![eiou])[b-z]o."i,s->s[1])

This creates an anonymous function which accepts a string as input and returns the inverse Rövarspråket transformation of the string. It's the exact inverse of my Julia answer to the Rövarspråket challenge. To call it, give it a name, e.g. f=t->....

The replace() function is doing all of the work here. The first argument is the input string, the second is a regular expression pattern (which in Julia is given as a string preceded by r), and the third is the replacement.

For the regex, we're matching all pairs of consonants separated by an "o". For the replacement, we're taking the match and extracting only the first character, which is the consonant.

Examples:

julia> f("hohelollolo")
"hello"

julia> f("MoMinon sosvovävovarore äror fofulollol momedod ålol")
"Min svävare är full med ål"

Questions? Just let me know. Suggestions? Very welcome as always!


Edit: Saved 18 bytes thanks to Martin Büttner!