Start a new topic

Credit card expiration date

I have a file with credit card expiration dates without any dashes or slashes. For example, it shows 319  as the date.  Can anyone help me with an expression that would translate that to 3/2019?


Hi Marie,


I'm sure this could be done on one line, and in a much cleaner fashion, but I'm still new to regex so I did it in two.  But it works!







Thanks, John! I appreciate your help.
I actually need a dictionary that will add a slash so it will be in the format of 2/19.
This is what I finally came up with.

Replacement value $1/$2
Values to match on (\d{2})(\d{2})
Login or Signup to post a comment