package cn.yyxx.eyuangame.core.utils

import android.text.TextUtils

/**
 * @author #Suyghur.
 * Created on 2021/06/25
 */
object EditTextUtils {

    fun filterAccount(input: String): Boolean {
        if (TextUtils.isEmpty(input)) {
            return false
        }
        if (input.length < 6 || input.length > 18) {
            return false
        }

        val regex = "^[0-9A-Za-z]{6,18}\$".toRegex()
        return regex.matches(input)
    }

    fun filterPwd(input: String): Boolean {
        if (TextUtils.isEmpty(input)) {
            return false
        }
        if (input.length < 6 || input.length > 18) {
            return false
        }

        val regex = "^[0-9A-Za-z]{6,18}\$".toRegex()
        return regex.matches(input)
    }

    fun filterPhone(input: String): Boolean {
        if (TextUtils.isEmpty(input)) {
            return false
        }
        return true
    }
}