Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

找不到这个工具类 PrincipalUtil #7

Closed
jing1115 opened this issue Dec 4, 2021 · 2 comments
Closed

找不到这个工具类 PrincipalUtil #7

jing1115 opened this issue Dec 4, 2021 · 2 comments

Comments

@jing1115
Copy link

jing1115 commented Dec 4, 2021

No description provided.

@JojinCui
Copy link

建议 你去gittee 上下载 https://gitee.com/gz-yami/mall4j 这个类的代码
`package com.yami.shop.common.util;

import cn.hutool.core.util.StrUtil;

import java.util.regex.Pattern;

/**

  • 正则表达式工具

  • @author LGH
    */
    public class PrincipalUtil {

    /**

    • 以1开头,后面跟10位数
      */
      public static final String MOBILE_REGEXP = "1[0-9]{10}";

    /**

    • 数字字母下划线 4-16位
      */
      public static final String USER_NAME_REGEXP = "([a-zA-Z0-9_]{4,16})";

    public static boolean isMobile(String value) {
    if(StrUtil.isBlank(value)) {
    return false;
    }
    return Pattern.matches(MOBILE_REGEXP, value);
    }

    public static boolean isUserName(String value) {
    if(StrUtil.isBlank(value)) {
    return false;
    }
    return Pattern.matches(USER_NAME_REGEXP, value);
    }
    }
    `

@gz-yami
Copy link
Owner

gz-yami commented Dec 28, 2021

github已经更新

@gz-yami gz-yami closed this as completed Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants