benma / visual-regexp.el

A regexp/replace command for Emacs with interactive visual feedback
392 stars 28 forks source link

Support for \0 or \& #53

Closed Silex closed 6 years ago

Silex commented 6 years ago

Hello,

It looks like there's no support for the whole match.

It'd be \& (or \0 with python steroids extensions), but none of them works.

Any idea? I'm fine with a python-only solution btw.

Right now I'm forced to add a capture group and use \1, kinda annoying when you simply want to do .* into \0. to add dots :-)

benma commented 6 years ago

\& works for me in visual-regexp. the steroids version is consistent with how re.sub() works of the Python stdlib.

What's your Emacs version and platform?

Silex commented 6 years ago

Okay, basically after some tests everything works as expected.

Without steroid regexps, \& works and with steroid regexps you are supposed to use \g<0> which is pretty annoying but ok, that's the way python works.

benma commented 6 years ago

Interesting. I could have sworn \0 used to work in Python.