Unless you have a supercomplex regex , I hardly see the benefits of serializing a compiled regex, the compilation time should not be that long. If you are not in a super-tight embed system?
In any case, dumping structures may be the solution, at least you can try ...
[EDIT] I just looked at the source that I have (6.7), and as I was afraid it wasn’t so simple, the structure starts with void * ... You cannot serialize pointers, you need to recount them.
source share