Creating a custom pattern(regx problem)


(W0lverine) #1

I am trying to parse a log to only recongize nubmers but the regex, though, it is a valid regex I am still getting a compile error. For example:
Custom pattern:
(?([0,1,2,3]) for:

[Priority: 0]

output:

Compile ERROR

I am new to regex first of all, but I have searched and searched and have yet come up with a solution of why this simple regx expression is getting a compile error, maybe it has to do with the fact logstash uses oniguruma regex?


(Magnus B├Ąck) #2

Your expression appears to open two parentheses but only closes one.

What is [0,1,2,3] supposed to mean? I suspect you actually mean [0123] or [0-3].


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.