/java-regex-validator

Java Regex validor for international data and Sri lankan data

Primary LanguageJava

Java Regex Validator for Sri lankan data

how to use

Validate International data

To validate international data you can use following methods.

  • isValidEmail(String email): Validates an email address using regex.
  • isValidUrl(String url): Validates a URL using regex.
  • isValidPhone(String phone): Validates a phone number using regex.
  • isValidId(String id): Validates an id using regex.
  • isValidText(String text): Validates a text using regex.
  • isValidNumber(String number): Validates a number using regex.
  • isValidDecimal(String decimal): Validates a decimal number using regex.
  • isValidPercentage(String percentage): Validates a percentage using regex.
  • isValidCreditCard(String creditCard): Validates a credit card number using regex.
  • isValidDate(String date): Validates a date using regex.
  • isValidImage(String image): validates an image using regex.
  • isValidYear(String year): Validates a year using regex.
  • isValidMonth(String month): Validates a month using regex.
  • isValidDay(String day): Validates a day using regex.

Validate Sri Lankan data

To validate Sri Lankan data you can use following methods.

  • isValidSlPhone(String phone): Validates a Sri Lankan phone number using regex.
  • isValidSlNic(String nic): Validates a Old Sri Lankan National Identity Card (NIC) using regex.
  • isValidSlNewNic(String nic): Validates a new Sri Lankan National Identity Card (NIC) using regex.