thekrakken / java-grok

Simple API that allows you to easily parse logs and other files
http://grok.nflabs.com/
Other
360 stars 151 forks source link

Named Capturing Group should support underline in name #65

Closed my2ndhead closed 7 years ago

my2ndhead commented 7 years ago

Hi

When using a named capturing group, the name should support underlines e.g.:

(?.*)

If I read the code correctly, this pattern just needs the _ added:

https://github.com/thekrakken/java-grok/blob/master/src/main/java/io/thekraken/grok/api/GrokUtils.java#L36

Thanks Mika>

my2ndhead commented 7 years ago

Can't be fixed in java-grok, as this is a http://www.docjar.com/html/api/java/util/regex/Matcher.java.html issue:

if (ASCII.isLower(nextChar) || 779 ASCII.isUpper(nextChar) || 780 ASCII.isDigit(nextChar)) { 781 gsb.append(nextChar);