Created
November 19, 2018 14:37
-
-
Save dharmayejju/0cb77098fdd91b9a36989f25d0c70c77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Masking inputs including char and digits | |
str = str.replace(/[a-zA-Z0-9-](?=[a-z0-9A-Z-]{4})/g, '*'); | |
//Masking just digits | |
str = str.replace(/\d(?=\d{4})/g, "*"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment