What's the file extension? Your challenge is to find the file extension of a provided filename:

hi.txt -&gt; txt or .txt
carrot.meme -&gt; meme or .meme
lol (undefined behavior)
what..is..this..file -&gt; file or .file
.bashrc -&gt; bashrc or .bashrc
T00M@n3KaPZ.h0wC[]h -&gt; h0wC[]h or .h0wC[]h
agent.000 -&gt; 000 or .000


You must get the text from the last .  or after the last . to the end of the string. The first capturing group match of the regular expression /\.([^.]+)$/ works, and so does splitting the input on .s and returning the last one.

The file name will always contain at least one ., but it may contain multiple .. (see examples)

The input will always match ^[.a-zA-Z0-9^!\[\]{}@$%+=]+$.
Retina, 5 bytes

.*\.



Replaces everything and a dot with nothing at all.

Try it online!