all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* extended regexp
       [not found] <mailman.923156.1354970579.854.help-gnu-emacs@gnu.org>
@ 2012-12-08 13:52 ` damien.thiriet77
       [not found] ` <mailman.14869.1354974731.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: damien.thiriet77 @ 2012-12-08 13:52 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,


I have been recently doing a lot of regexp with grep, sed and emacs and I think differences between regexp syntax of those programs are a bit confusing (I am using GNU sed, GNU grep and GNU emacs). Extended regexp somehow unify these syntaxes, and I would link to know if there is a way to implement them in emacs regexp search and replace. I would like to do so for another reason: I have quite often to escape ( and { in my regexp, which is quite tedious. Of course, I suppose the default behaviour of ( in regexp is connected with lisp syntax, but I mostly use search-replace in texts with few (). I made a research in both emacs info manual and emacs wiki and couldn’t find anything on it. As far as I remember, vim has got such extended regexp-like functions.

If there is no extended-regexp functions nor mode avalaible, I may send a feature request for it (the idea would be to have a regexp variable for usual or extended search and replace). However, do you think someone else might be interested by such a behaviour? 


Damien Thiriet




Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: extended regexp
       [not found] ` <mailman.14869.1354974731.855.help-gnu-emacs@gnu.org>
@ 2012-12-10 15:05   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2012-12-10 15:05 UTC (permalink / raw)
  To: help-gnu-emacs

> If there is no extended-regexp functions nor mode avalaible, I may
> send a feature request for it (the idea would be to have a regexp variable
> for usual or extended search and replace).  However, do you think someone
> else might be interested by such a behaviour?

We'd be happy to use a cleaner regexp syntax, but doing it without
breaking backward compatibility is tricky, unless you go the
`rx' route.  E.g. provide a new function/macro (call it `re') which
converts between your new syntax and the old one.


        Stefan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: extended regexp
       [not found] <mailman.191.1355158842.18015.help-gnu-emacs@gnu.org>
@ 2012-12-11  5:23 ` Jon Oddie
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Oddie @ 2012-12-11  5:23 UTC (permalink / raw)
  To: help-gnu-emacs


>> If there is no extended-regexp functions nor mode avalaible, I may
>> send a feature request for it (the idea would be to have a regexp variable
>> for usual or extended search and replace).  However, do you think someone
>> else might be interested by such a behaviour?
> 
> We'd be happy to use a cleaner regexp syntax, but doing it without
> breaking backward compatibility is tricky, unless you go the
> `rx' route.  E.g. provide a new function/macro (call it `re') which
> converts between your new syntax and the old one.
> 

FWIW, I started work on something like this a while back, called
`pcre2el'[1]. It is a bit misnamed, since the majority of PCRE is too
difficult to support by simple translation to Emacs native regexes,
but it does cover the simple cases.  It also converts the string forms
to `rx' syntax, and extends the RE-Builder to handle these
conversions, so you can use C-c TAB to switch transparently between
PCRE-like, Emacs and rx syntax.



    Jon

[1] https://github.com/joddie/pcre2el




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-11  5:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.191.1355158842.18015.help-gnu-emacs@gnu.org>
2012-12-11  5:23 ` extended regexp Jon Oddie
     [not found] <mailman.923156.1354970579.854.help-gnu-emacs@gnu.org>
2012-12-08 13:52 ` damien.thiriet77
     [not found] ` <mailman.14869.1354974731.855.help-gnu-emacs@gnu.org>
2012-12-10 15:05   ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.