/**
 * Resolve after `time` has been spend.
 *
 * @param time Time in milliseconds to wait
 */

const regex = {
    bizNo: /^[0-9]{3}-[0-9]{2}-[0-9]{5}$/i,
    email: /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i,
    password: /^(?=.*[a-zA-Z])(?=.*[!@#$%^*+=-])(?=.*[0-9]).{8,15}$/i,
    currency: /\B(?=(\d{3})+(?!\d))/g,
}

// 천단위 콤마 포맷 함수 추가
export function formatCurrency(value) {
    if (value === null || value === undefined || value === '') return ''
    const num = Number(value.toString().replace(/[^0-9.]/g, ''))
    return isNaN(num) ? '' : num.toLocaleString()
}

export default regex