const sanitize = (str) => {
    const regex = /[^0-9]/gi;
    return str.replace(regex, '');
};
const getCodeFromClipboard = (digits, pasteValue) => {
    const regex = new RegExp(`\\d{${digits}}`);
    const sanitizeText = sanitize(pasteValue);
    const match = regex.exec(sanitizeText);
    if (!match) {
        return '';
    }
    return match[0];
};
export default getCodeFromClipboard;
