2018-03-28 java Groovy正则表达式用法 Matcher example: 1234567891011//Matcher exampleString regexStr = /gr.*/String str = 'groovy'Matcher matcher0 = (str =~ regexStr)boolean result0 = (str ==~ regexStr)assert matcher0.matches() == result0Matcher matcher1 = (str =~ /$regexStr/)boolean result1 = (str ==~ /$regexStr/)assert matcher1.matches() == result1 Find example: 123456def cool = /gr\w{4}/ // Start with gr followed by 4 characters.Matcher matcher2 = ('groovy, java and grails rock!' =~ /$cool/)assert 2 == matcher2.countassert 2 == matcher2.size() // Groovy adds size() method.assert 'groovy' == matcher2[0] // Array-like access to match results.assert 'grails' == matcher2.getAt(1) Newer Amazon API Gateway 返回406解决方法 Older Sl4j+Logback依赖配置