For a project I'm currently working on, I'm looking to embed a scripting engine into my C++ code to allow for some extensibility down the line. The application will require a fair amount of text processing and the use of regular expressions within these scripts.
I know Lua is generally the industry darling when it comes to embedded scripting, but I also know it doesn't support regular expressions (at least out of the box). This is causing me to lean toward python for my language to embed, as it seems to have the best support behind Lua and still offers powerful regex capabilities.
Is this the right choice? Should I be looking at another language? Is there a reason I should give Lua a second look?
if you need specifically what is commonly known as 'regular expressions' (which aren't regular at all), then you have two choices:
if, on the other hand, you need any good pattern matching, you can stay with Lua and either:
As you can tell, i'm a big fan of the last. It not only lets you define very complex but deterministic patterns, it's a full grammar tool that you can use to create a whole parser. If you wish, the grammar can be described in a single multi-line string constant, with your own defined hooks to capture data and build your structures.
i've used it to quickly hack a JSON parser, a C call-tree, an xPath library, etc.