IT 웹개발/Java
[자바] 영문, 숫자, 특수기호 -, _ 으로 이루어졌는지 확인 정규식
붕어,짐
2022. 1. 15. 22:04
728x90
반응형
String pattern = "[a-zA-Z0-9-_]*$";
String str = "test-123"
boolean result = Pattern.matches(pattern, str);
정규식 사이트
RegExr: Learn, Build, & Test RegEx
RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp).
regexr.com
728x90
반응형
LIST