[ "foobar.a", "foobar.txt", "foobar.foobar1234" ].forEach( t => console.log( t.match(/.[0-9a-z]+$/i)[0] ) )