[Question]
  [
Língua do Pê, or P Language, is a language game spoken in Brazil and Portugal with Portuguese. It is also known in other languages, such as Dutch and Afrikaans. ([Wikipedia](https://en.wikipedia.org/wiki/L%C3%ADngua_do_P%C3%AA))
There are some dialects in this language game. The different languages the game is played with even have their own unique dialects. Some people are fluent in speaking P Language and the best can even translate any text to their preferred dialect on the spot!
# P Language
In this challenge, we will use the *Double Talk* dialect.
To translate text into P Language, any sequence of vowels in the text is appended with a single `p` character followed by a copy of the sequence of vowels.
# Challenge
Write a function or program that accepts a string as input and outputs its translation in P Language.
* The input consists only of printable ASCII characters.
* The output consists only of the translated input and optionally a trailing newline.
* Vowels are any of the following characters `aeiouyAEIOUY`.
* A sequence of vowels is delimited by any other character. The string `"Aa aa-aa"` has three vowel sequences.
* Leading and trailing whitespace may optionally be omitted from the translated output string.
# Examples
```
""                              =>   ""
"Lingua do Pe"                  =>   "Lipinguapua dopo Pepe"
"Hello world!"                  =>   "Hepellopo woporld!"
"Aa aa-aa"                      =>   "AapAa aapaa-aapaa"
"This should be easy, right?"   =>   "Thipis shoupould bepe eapeasypy, ripight?"
"WHAT ABOUT CAPS?"              =>   "WHApAT ApABOUpOUT CApAPS?"
"   Hi "                        =>   "   Hipi " or "Hipi"
```
The double quotes character `"` is used to delimit the input and output strings in the examples but obviously this character may also appear in any valid input string.
  
[Answer]
# JavaScript (ES6), 35 bytes
```
s=>s.replace(/[aeiouy]+/gi,'$&p$&')
```
[Try it online!](https://tio.run/##fdHBToNAFIXhvU9xJU0LsS1PUBt0w6KJTaxxYVzcwhTGTJgTpmj69Dh36IqKLAiL7/xh4Iu/2RWtxnnV2FL1p03vNo9u3SoYLlScfrDStrt8PqSVXi5mc8zmi6QvbOOsUWtjq/gUR1GS0D9XmlIU3Y02O91UHVNpaa/@2MtmpxEQgoNIqJtQroyx9GNbU95PhHK/8wjCMMBxJWNiXjFPHEUqGSMoBOjvN5FDrR252nampKMixe6ypFZX9XkrXYl4givC1UEkBCNwDINx/D3PDpQ9vbwd6Dnbv25HbypxTyAIwjBIBDuO@UGuafK/SSwQeES29Z/QP0b9Lw "JavaScript (Node.js) – Try It Online")
Where the special replacement pattern `$&` means *[matched substring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter)*.
[Answer]
# Sed, ~~30~~, ~~25~~, ~~21~~, 19 Bytes
-5 Bytes Thanks to Arnauld!  
-4 Bytes Thanks to Shaggy!  
-2 Bytes Thanks to Leo Tenenbaum!
```
s/[aeiouy]\+/&p&/gi
```
[Try it Online!](https://tio.run/##BcGxCsIwEAbg/Z7id@mikkco0SWDYMEUB3U4yZEcBCONofTp4/dVCb1X82DR0rbXc2@G72Ci9k4X/cTGCAWTkJOcC9ay5LAjy2A@MpNPWlFTaTngLRCu2wGLxvQb6e6shz1dZ4@znW4jAXCKPw)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 bytes
```
r"%y+"_+ip
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=ciIleSsiXytpcA&input=IkhlbGxvIHdvcmxkISI)
```
r"%y+"_+ip     :Implicit input of string
r              :Replace
 "%y+"         :RegEx /[aeiouy]+/gi
      _        :Pass each match through a function
       +       :  Append a copy of the match
        ip     :  Prepended with "p"
```
[Answer]
# Java 8, 40 bytes
```
s->s.replaceAll("(?i)[aeiouy]+","$0p$0")
```
[Try it online.](https://tio.run/##ZVDBbsIwDL3zFV6ERKrSivPQhrpdetgYUjvtABxMm9GwkFRNwlRNfHsXSjh0u1i233t@tg94wuhQfnWFQK3hFbn8GQFwaVjziQWD5aUEyEzD5R4K6hMdzF3/PHJBGzS8gCVIeOh09KjjhtXCaRMhKKELHqyRcWXbbUimZDyrxzMSdPOLtLY74aR@wknxEo5uA2@y3gIGV3vDtKGE9Ka36sVRLEKpYMWGSMqEUPCtGlHeDZEEATFCHHbzimvQlbKihB0DhrqdQsP3lVkMiR9pkkPy9Paew3Oyyv6gLkk5kH@f6e/qKf55XNbW@MuyVht2jJU1ce1AIySdkEnYU0KyIfewISSUcUGvqtCh3uHc/QI)
**Explanation:**
```
s->                              // Method with String as both parameter and return-type
  s.replaceAll("(?i)[aeiouy]+",  //  Replace the regex matches
               "$0p$0")          //  With this replacement
```
*Regex explanation:*
```
(?i)[aeiouy]+                    // MATCH:
(?i)                             //  Enable case insensitivity
            +                    //  Match one or more
    [aeiouy]                     //  Adjacent vowel characters
$0p$0                            // REPLACEMENT:
$0                               //  The entire match (the vowel 'sequence')
  p                              //  Appended with a literal "p"
   $0                            //  Appended with the entire match again
```
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 20 bytes
```
s/[aeiouy]+/$&p$&/gi
```
[Try it online!](https://tio.run/##BcGxCsIwEAbg/Z7iF0oXLZmcS3TpULBgxUEcThqSg9ALTYv05Y3fl9wSz6Vk82Inuu3vo6nqVNXGSynUy@w3xqQYHHUuRsVXlzgdyDKYG2Yag2TkoFuc8HFwnPcTFvFhbenZ2RH2cnuMuNrh3hKATvDTtIrOuTTpDw "Perl 5 – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 55 bytes
```
lambda s:re.sub('([aeiouy]+)',r'\1p\1',s,0,2)
import re
```
[Try it online!](https://tio.run/##BcHBSsQwFAXQfb7iumqCURxdCAMyVDddCA5YcWEHeaVp@yCThJcE6dfXc9JW1hie9vll2D1dx4mQj@Lucx11o3/Icazb5dY0VprhkIZDY7N9sI9G8TVFKRC3z1HwCw4QCovTz@aYhEPRs@aQatHGmF29c1gqYYo4O9U57yP@ovjpRrUEojsi1a@ckddY/YTRwVHeLISXtZzUd9f2aF8/vnq8tefPkwLQMf4B "Python 3 – Try It Online")
---
Sans regex:
# [Python 3](https://docs.python.org/3/), 101 bytes
```
def f(s,q=''):i=s[:1];t=i in{*'aeiouyAEIOUY'};return(q+(q!='')*'p'+q+i)*0**t+(s and f(s[1:],(q+i)*t))
```
[Try it online!](https://tio.run/##HYxbS8MwFIDf8yvOnnJpBYcPQkcZUYQKwgZ2yBhjnJG0PVCSNkmRIv72uvn8XYY5dd49LYuxDTQi5mPJuSyojKdifd6kkoDcj@JoyU@zfnvfHY78dxNsmoITYybG1T1QfODZmJFUj0qlTERAZ@6/07o45@KfJCmXxge43I4Q0LVWPMtiCOSSaAS5YUpC3hz2Qa6dEIyHvWWV7XsP3z70ZsU0AuIDIqs7ihA7P/UGrhYsxjmHQG2Xtuyr0jXol92hhle9/9wyAKgI/gA "Python 3 – Try It Online")
Python 3.8 (pre-release): [99 bytes](https://tio.run/##DYxdS8MwFIbv8yvOrvLRDhxeKIEy6hAqCBvYIWMMOaNpe6AmaZIiRfzttXfvA8/z@jn1zj4@@7AsbTHg971BiPlYcK7FmIlxsy6puOfZSqSLeNW7m5TqQSmRdEFA9ldxNOSmuXx9O54v/E9mIgLaBloRrzt9y9cnkipJubQuwNfaQEDbGfEktQ9kk2gFWT8lIVeHvZPtJoTGwcmwygyDgx8XhmbDSgTELSKre4oQezcNDdwNGIxzDoG6Pu3ZZ1XWUL4czzUcytPHngFARfAP "Python 3.8 (pre-release) – Try It Online")
## Explanation
Recursive function, accepting a string `s` and an optional argument `q`. If the first character of `s` (`i`) is a vowel, it is stored in the queue `q`. If not, a string is returned which is composed of `q`, the letter `'p'`, `q` again, the character `i` and the result of the recursive function with the first character of the string stripped off. Recursion stops when the function encounters an empty string `s`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~22~~ 20 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
.γžÁyå}vyžÁyнåi'py}J
```
05AB1E doesn't have any regexes unfortunately.  
I don't really like the duplicated `žÁyнå`, but I'm currently a bit too busy to look for alternatives..
-2 bytes thanks to *@Grimy* for showing me a constant I didn't even knew existed (and was missing from the Wiki page.. >.>)
[Try it online](https://tio.run/##yy9OTMpM/f9f79zmo/sON1YeXlpbVglmXdh7eGmmekFlrdf//yEZmcUKxRn5pTkpCkmpCqmJxZU6CkWZ6Rkl9gA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9TVmmvpPCobZKCkn3lf71zm4/uO9xYeXhpbVklmHVh7@GlmeoFlbVe/2t1/nuk5uTkK5TnF@WkKHI5JiokJuomJnKFZGQWKxRn5JfmpCgkpSqkJhZX6igUZaZnlNhzhXs4hig4OvmHhig4OwYE23MpKCh4ZCoAAA).
**Explanation:**
```
.γ               # Group the characters in the (implicit) input-string by:
  žÁ             #  Push vowels builtin: "aeiouyAEIOUY"
    yå           #  And check if the current character is in this string
 }v              # After grouping: loop over each group `y`:
   y             #  Push group `y`
    žÁyнåi   }   #  If the first character of the group is a vowel:
          'p    '#   Push a "p"
            y    #   And push group `y` again
              J  #  Join everything on the stack together to a single string
                 # (after the loop, implicitly output the result)
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 17 bytes
```
i`[aeiouy]+
$&p$&
```
[Try it online!](https://tio.run/##BcFBCsIwEAXQ/ZziC6Ub9QwluslCsGBKFyI4kqEZCI0kDdLTx/eybLpya/p@smiq@@tIXf/t@tboputSGT5hFLISY8Iv5egPZBjMZ2ZyQQtKSDV6fATCZT8h6xK2gWZrHMzlPjlczfgYCIBV/AE "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation: Trivial regexp approach; the `i` flag turns on case insensitivity (Retina already defaults to a global match).
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 20 bytes
```
Żṁe€ØyŒg$$,j”pƊ€ÐeẎḊ
```
[Try it online!](https://tio.run/##y0rNyan8///o7oc7G1MfNa05PKPy6KR0FRWdrEcNcwuOdYGEJqQ@3NX3cEfX////lXwy89JLExVS8hUCUpUA "Jelly – Try It Online")
[Answer]
# [Red](http://www.red-lang.org), 92 bytes
```
func[s][v: charset"aeiouyAEIOUY"parse s[any[to v copy t any v insert(rejoin["p"t])| skip]]s]
```
[Try it online!](https://tio.run/##TYrBasMwEETv@YqpTi00P5BLUEvBhUJC4lCK0GFrrWMlRhJaOcXQf3fdS@vTzJs3md10YGfsqt1gaofQGLHmtkHTURYuitjHYdQvr7vTh0q/G8RQGE2JuKGJaUTBzDP4IJzLfeZL9MGopIp9@IZcfbJW7JSyDwUtlFr91TcfzgPBRexZAf@i4r6P@Iq5d3eLvyYQrYkWU915gXRx6B0@GUwyPiL7c1e2i9d7pWvop92pxrPeH5cKQOXnmH4A "Red – Try It Online")
Of course [Red](http://www.red-lang.org)'s `Parse` is much more verbose than `regex`.
[Answer]
# [SNOBOL4 (CSNOBOL4)](http://www.snobol4.org/csnobol4/), 97 bytes
```
	I =INPUT
S	I ARB . L SPAN('AEIOUYaeiouy') . V REM . I	:F(O)
	O =O L V 'p' V	:(S)
O	OUTPUT =O
END
```
[Try it online!](https://tio.run/##K87LT8rPMfn/n9NTwdbTLyA0hCsYyHQMclLQU/BRCA5w9NNQd3T19A@NTEzNzC@tVNcESoQpBLn6AmlPTis3DX9NLk5/BVt/oPIwBfUCdYUwTiuNYE0uf07/0BCggUApLlc/l///fTLz0ksTFVLyFQJSAQ "SNOBOL4 (CSNOBOL4) – Try It Online")
Vowel clusters match `SPAN('AEIOUYaeiouy')`.
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 17 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
àº`≈Zö=q╦ⁿ↔èblTï÷
```
[Run and debug it at staxlang.xyz!](https://staxlang.xyz/#p=85a760f75a943d71cbfc1d8a626c548bf6&i=%0ALingua+do+Pe%0AHello+world%21%0AAa+aa-aa%0A%22This+should+be+easy,+right%3F%0AWHAT+ABOUT+CAPS%3F%0A+++Hi+&a=1&m=2)
### Unpacked (20 bytes) and explanation:
```
Vv'y+c^+:}'++{'pnL}R
                   R    Regex replace using
                        Pattern:
Vv'y+                     Push "aeiou", push "y", and concatenate
     c^+                  Copy, convert copy to all caps, and concatenate
        :}                Enclose in []
          '++             Push "+" and concatenate
                        And replacement:
             {    }       Block:
              'p            Push "p"
                n           Copy second item (matching substring) to top
                 L          Listify
                          Implicit concatenate
                        Implicit print
```
No case-insensitive regular expressions in Stax, and the vowel builtins don't include Y. The documentation won't tell you about using a block as a replacement, but it's a working feature nevertheless.
]