split pop || match || exec || substring lastIndexOf - get file extension (v29)

Revision 29 of this benchmark created on


Preparation HTML

<script>
	var str = "F9g.wEu.Fchjt.Y3.JM.mp4";
	var regexp = /[.][A-Za-z0-9]+$/;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
split pop
regexp.exec(str)[0];
ready
RegEx match
str.match(regexp)[0];
ready
RegEx exec
str.split('.').pop();
ready
substring lastIndexOf
str.substring(str.lastIndexOf("."));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.