User forums > Using Code::Blocks

Regular expression search/replace

(1/1)

Revvy:
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;
}
--- End code ---

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

Ceniza:
Text to search for: state->get_svar("\([^"]+\)")
Replace with: \1

Navigation

[0] Message Index

Go to full version