문서의 이전 판입니다!
regex, 정규표현식
// "/" 로 RegEx를 만들면 "\" 를 escape 하지 않아도 된다. Pattern patternWithSlash = ~/\d*\w*/ Pattern patternWithQuotes = ~"\\d*\\w*" println patternWithSlash.pattern() == patternWithQuotes.pattern() // true // 일부 매치. java.util.regex.Matcher 객체 리턴. // 리턴된 객체는 일부라도 매칭이 되면 true로 평가되고, 매칭 되는 것이 없으면 false로 평가된다. "cheesecheese" =~ ~/cheese/ // 완전 매치, boolean 리턴 '문자열' ==~ ~/패턴/