Author Topic: Regular expression search/replace  (Read 4594 times)

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Regular expression search/replace
« 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: [Select]
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
« Last Edit: June 16, 2006, 02:56:17 am by Revvy »
Cheers,
Revvy

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Regular expression search/replace
« Reply #1 on: June 16, 2006, 03:38:06 am »
Text to search for: state->get_svar("\([^"]+\)")
Replace with: \1