All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hope.kola.contract.faker.ChineseIDPulsar Maven / Gradle / Ivy

There is a newer version: 1.1.2-RELEASE
Show newest version
package hope.kola.contract.faker;

import com.mifmif.common.regex.Generex;

/**
 * 
 * 十八位:
 *
 * ^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$
 *
 * 十五位:
 *
 * ^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$
 *
 * 
 */
public class ChineseIDPulsar implements Pulsar {

  protected Generex OG =
      new Generex(
          "[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]");

  protected Generex NG =
      new Generex("[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}");

  @Override
  public String next() {
    return OG.random();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy