Я допускаю значительное отклонение от предпочтения PCRE regexps намного лучше, чем emacs, если нет другой причины, по которой я набираю '(' Я почти всегда хочу оператора группировки. И, конечно же, \w и подобные SO намного удобнее других эквивалентов.
Но было бы безумным ожидать, конечно, изменения внутренних элементов emacs. Но должно быть возможно преобразовать из экспрессии PCRE в выражение emacs, я бы подумал, и сделать все необходимые преобразования, чтобы я мог написать:
(defun my-super-regexp-function ...
(search-forward (pcre-convert "__\\w: \d+")))
(или аналогичный).
Кто-нибудь знает библиотеку elisp, которая может это сделать?
Изменить: выбор ответа из ответов ниже...
Ничего себе, мне нравится возвращаться с 4-х дней отпуска, чтобы найти множество интересных ответов для сортировки! Мне нравится работа, которая вошла в решения обоих типов.
В конце концов, похоже, что обе версии exec-a- script и прямые elisp решения будут работать, но с чистой скоростью и "правильным" подходом версия elisp, безусловно, такова, что люди будут предпочитаю (включая меня).