mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Added NONNEGINT to patterns
Commit e62536a
introduced a complication: there are times when one
wants to match against zero as well as the positive integers (such
as in the LINUXTTY pattern). For these times, NONNEGINT can be used.
Existing users of POSINT might continue to expect zero to match, so
this change should probably be mentioned in the release notes (on the
other hand, some could be using POSINT without wanting it to match
zero, as happened to me).
Ref: Paragraph 3 of http://en.wikipedia.org/wiki/Natural_number
This commit is contained in:
parent
e9cd3446fb
commit
a411cdca0d
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+))
|
|||
BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b
|
||||
|
||||
POSINT \b(?:[1-9][0-9]*)\b
|
||||
NONNEGINT \b(?:[0-9]+)\b
|
||||
WORD \b\w+\b
|
||||
NOTSPACE \S+
|
||||
SPACE \s*
|
||||
|
@ -31,7 +32,7 @@ HOSTPORT (?:%{IPORHOST=~/\./}:%{POSINT})
|
|||
PATH (?:%{UNIXPATH}|%{WINPATH})
|
||||
UNIXPATH (?:/(?:[\w_%!$@:.,-]+|\\.)*)+
|
||||
#UNIXPATH (?<![\w\/])(?:/[^\/\s?*]*)+
|
||||
LINUXTTY (?:/dev/pts/%{POSINT})
|
||||
LINUXTTY (?:/dev/pts/%{NONNEGINT})
|
||||
BSDTTY (?:/dev/tty[pq][a-z0-9])
|
||||
TTY (?:%{BSDTTY}|%{LINUXTTY})
|
||||
WINPATH (?:[A-Za-z]+:|\\)(?:\\[^\\?*]*)+
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue