regex test (v2)

Revision 2 of this benchmark created on


Setup

const text="I don't know what I'm doing"

Test runner

Ready to run.

Testing in
TestOps/sec
reducer
const isString = (typeof text !== 'string');
['‘', '’', '`', 'ʼ'].reduce(
    (acc, char) => acc.split(char).join("'"),
    text
);
ready
regex
const isString = (typeof text !== 'string');
const apostropheRegex = /[‘’`ʼ]/g;
return text.replace(apostropheRegex, "'");
ready

Revisions

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