how do you think using memory-free parentheses and lookahead\lookbehind assertions? they can contribute to efficiency since they are not memory based, of course you can use these in conditional contexts of matching. Just thought of suggesting something in addition.
Excellence is an Endeavor of Persistence.
Chance Favors a Prepared Mind