[복붙용] 개인정보 정규식
개인정보 탐지을 위한 정규식
class regex
{
String[] infos = {"0(2|31|32|33|41|42|43|51|52|53|54|55|61|62|63|64|10|11|16|17|18|19|12|15)([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{3,4})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})" //전화번호
,"(\\d{6})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{1})(\\d{6})" //주민등록번호
,"([0-9a-zA-Z])([-_\\.]?[0-9a-zA-Z]){0,20}(@)([0-9a-zA-Z]([-_\\.]?[0-9a-zA-Z]){0,254}\\.[a-zA-Z]{2,4})"//이메일
,"(\\d{4})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{3})(\\d{1})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})"//카드번호
,"(\\d{3})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{2})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})(\\d{1})" //사업자등록번호
,"(서울|부산|대구|인천|광주|대전|울산|경기|강원|충북|충남|전북|전남|경북|경남|제주)([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{2})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{6})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{2})" //운전면허번호
,"(^|\\s)([a-zA-Z]{2})(\\d{3})(\\d{4})($|\\s)"}; //여권번호
String PH = "0(2|31|32|33|41|42|43|51|52|53|54|55|61|62|63|64|10|11|16|17|18|19|12|15)([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{3,4})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})";
String person = "(\\d{6})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{1})(\\d{6})";
String mail = "([0-9a-zA-Z])([-_\\.]?[0-9a-zA-Z]){0,20}(@)([0-9a-zA-Z]([-_\\.]?[0-9a-zA-Z]){0,254}\\.[a-zA-Z]{2,4})";
String card = "(\\d{4})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{3})(\\d{1})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})";
String SAUP = "(\\d{3})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{2})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{4})(\\d{1})";
String car = "(서울|부산|대구|인천|광주|대전|울산|경기|강원|충북|충남|전북|전남|경북|경남|제주)([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{2})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{6})([-\\s\\t\\n\\x0B\\f\\r]*)(\\d{2})";
String girlscandoanypang = "(^|\\s)([a-zA-Z]{2})(\\d{3})(\\d{4})($|\\s)";
}
댓글
댓글 쓰기