Grok Patterns Contd
Regular Expressions
- Characters
- Escape character: \
- Any character: .
- Digit: \d
- Not a digit: \D
- Word character: \w
- Not a word character: \W
- Whitespace: \s
- Not whitespace: \S
- Word boundary: \b
- Not a word boundary: \B
- Beginning of a string: ^
- End of a string: $
- Groupings
- Matches characters in brackets: [ ]
- Matches characters not in brackets: [^ ]
- Either or: |
- Capturing group: ( )
-
Quantifiers
- 0 or more: *
- 1 or more: +
- 0 or 1: ?
- An exact number of characters: { }
- Range of number of characters: {Minimum, Maximum}
- refer to the classroom video for examples