Justin Jose
Justin Jose

Reputation: 71

find and replace a string using regular expression

i need to find

sessionOpen(0, (int *)(&SessionId));

and replace the same as follows,

sessionOpen(
\#if USE_MULTIPLE_DB
              0,
\#endif
 (int *)(&SessionId));

how can i achieve this using regular expression search and replace method????

Upvotes: 1

Views: 896

Answers (1)

Bohemian
Bohemian

Reputation: 425348

replace sessionOpen\((0), \(int \*\)\(&SessionId\)\);

with sessionOpen(\n#if USE_MULTIPLE_DB $1, #endif\n(int *)(&SessionId))

(I assume you want to capture the zero 0)

Upvotes: 1

Related Questions