Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Revvy on June 16, 2006, 02:48:18 am

Title: Regular expression search/replace
Post by: Revvy on June 16, 2006, 02:48:18 am
How am I supposed to use the regular expression option for find/replace?  I have this block of code:

Code
if(max(state->get_svar("sel_x"), state->get_svar("sel_x2")) < (s32)(state->get_svar("view_x") + state->get_uvar("view_width")))
{
if(max(state->get_svar("sel_x"), state->get_svar("sel_x2")) < state->get_svar("view_x"))
{
w = 0;
draw_right = false;
}
else
w = max(state->get_svar("sel_x"), state->get_svar("sel_x2")) - min(state->get_svar("sel_x"), state->get_svar("sel_x2")) + 1;
}

and I tried to use this search regex:

state->get_svar\("(.+)"\)

and this replace regex:

\1

Nothing happened.  I tried just searching for the first, and it didn't find anything.  Why isn't this working?

ps. latest nightly build
Title: Re: Regular expression search/replace
Post by: Ceniza on June 16, 2006, 03:38:06 am
Text to search for: state->get_svar("\([^"]+\)")
Replace with: \1