My Electron app needs to store and retrieve from a sqlite db objects like this:
{"name":"my regexp","regexp":/somespattern/i}
(real objects are much larger and much more complex.)
I started by storing stringified object in a field, but since JSON.stringify() does not handle regular expressions and converts them to {}, I had to convert all regexps to strings, which stringify() then escapes. I end up with very convoluted code in many functions.
If anyone has solved this problem elegantly either with JSON or XML, I would love a good solution. Would CDATA help?