Home Debit Card Exp Date Format
Post
Cancel

Debit Card Exp Date Format

Edit Validate rules

Format

  • Ex: 05 24
1
2
3
4
5
6
7
8
9
10
11
12
13
//In format (MM YY)
// Regex to check valid Exp Date
String regex= ("^(0[1-9]|1[0-2])\\s([0-9]{2})$");
// Compile the ReGex
  java.util.regex.Pattern p=java.util.regex.Pattern.compile(regex);

// If the string is empty, return false
if (theValue == null || theValue.trim().equals("")) return false;
theProperty.addMessage("Please Enter Valid Expiry date");

// Pattern class contains matches() method to match the given string and regular expression
java.util.regex.Matcher m = p.matcher(theValue);
return m.matches();

Reference

Click Here - More details from pega academy for Edit Validate rules

This post is licensed under CC BY 4.0 by the author.

Pan Format

Debit Or Credit Card Auto Space

Comments powered by Disqus.