[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using non-Emacs regexp syntax
From: |
Juri Linkov |
Subject: |
Re: using non-Emacs regexp syntax |
Date: |
Sun, 03 Dec 2006 22:22:41 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.90 (gnu/linux) |
> * Each implemented format provides a table of associations
> construct-name -> construct-generator (some constructs, like []
> character class, will require a parameter.) In the simplest form,
> construct-generator can be just a fixed string, which will suffice in
> most cases.
>
> * Each format also provides a parser that splits a regexp into a list
> of construct-name.
>
> * Entry function (or a helper for it) combines together a table for
> output format and a parser for input format. The result is a regexp
> in output format.
A good implementation would parse a regexp string to the sregex
Lisp-like syntax (qv emacs-lisp/sregex.el) which would allow doing
such things as (sregexq (a-new-function-to-parse-Perl-regexp PERL-REGEXP))
to convert a non-Emacs regexp to the Emacs one.
PS: I would much prefer to use this feature in query-replace-regexp
with an option to use extended regexps instead of basic regexps in its
interactive arguments.
--
Juri Linkov
http://www.jurta.org/emacs/