tis 2019-05-14 klockan 09:25 +0200 skrev philippe schnoebelen: > I was wondering why (regexp-opt nil) uses a\` and not \'a or another > option like \=a\= so I did some profiling (see attached code). Thank you, and sorry about my bad initial attempt. I tried a few more, like [z-a], \c* and \sq, but these were no better. The distribution is decidedly bimodal; there seems to be no significant difference between the 'fast' ones, so I went with \`a\` in the attached patch. > Of course this may be dependent on the internals of the specific > regexp library at hand. I do not know enough to judge. In fact I > believe that a solid regular expression library should provide a > specific regular expression that matches nothing with special but > easy treatment that guarantees best response time. We could add a standard constant for it, like unmatchable-regexp, so that at least people don't keep reinventing it. We could also make (rx (or)) work. (It does in my complete rx rewrite.)