Find and replace with regex

General questions regarding the usage of CodeLite
Jarod42
CodeLite Expert
Posts: 190
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Find and replace with regex

Post by Jarod42 » Fri Sep 04, 2020 6:28 pm

Whereas I found the checkbox to search using regex, replaced string doesn't seem to respect the flag

For example:
Replace

Code: Select all

range::foo\((.*)\)
by

Code: Select all

bar(begin(\1), end(\1))
with

Code: Select all

range::foo(var)
results in:

Code: Select all

bar(begin(\1), end(\1))
instead of expected

Code: Select all

bar(begin(var), end(var))
Should I use other token than \1 (for group1)? (I also tried with $1)

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Find and replace with regex

Post by eranif » Thu Oct 01, 2020 2:59 pm

this sounds about right (using \1)
seems like a bug
Make sure you have read the HOW TO POST thread

Post Reply