I think you have to stretch the definition of "programming language" a lot before you can fit regexes into it. And while admittedly I don't know what goes on under the hood in the average compiler, how can something entered at runtime be compiled? They sure look like data to me. We could probably argue about it all day and not come to an agreement. However, I think we can agree that they aren't what the ordinary person thinks of as a programming language -- they're just a form of representing data. So the troll was highly misleading, at best, and no doubt intentionally so.
But anyway, all annoying trolls aside: I have regexphobia. I can deal with them -- I don't have much choice, being a website developer and all -- but I'll admit, they scare me, and if humanly possible, I find an existing one and modify it as needed. I haven't had to write any for calibre yet. You'll know when I have to deal with a tricky one in calibre by the pathetic, pleading, whimpering plea for help on this forum, probably titled "Don't let the regex get me!" So even though there can't really be universally useful regexes, I'm very much in favor of some way of providing a good selection of models that can be modified to suit individual requirements. That would make life a lot easier for a lot of people. The suggestions that have come up in this thread seem like a Very Good Thing to me.
P.S. Starson, so am I. That's why I said "rightfully". I don't regret my post, though. Some things need to be said.
|