guillermooo/Vintageous

extra parenthesis search and replace bug

jasjuang opened this issue · 2 comments

For example, let say I have

(test)

:%s/(\(.*\))/[\1]/g 

In vim it shows

[test]

However, typing this in vintageous shows

[(test)]

Vintageous uses the Python regex engine, which takes the opposite approach of vim with regard to literal parentheses. In a Python regular expression, you escape the literal parentheses, and a group is represented by bare parentheses. So to achieve the same result as vim for your test, you would instead use the following.

:%s/\((.*)\)/[\1]/g

I believe it is stated somewhere that implementation of vim regex syntax is not a goal of the project, so this issue will likely not be considered a bug.

That works. Thanks for the explanation!