I would like to use regexes in a linux kernel module.
I have the regexes ready, and I tested them in user space with
The kernel already has a regexp engine; the functions are declared in kernel/trace/trace.h. It is part of the linux trace framework, and could relatively easily be adapted. You can see where it is currently used (identifier search).
You could also pass the packets to userspace via a socket using
libipq, classify them, and pass them back. This is an easier approach, but slower, and apparently isn't what you want (but might be useful to another reader).