I would like to find a line that begins with a variable number of spaces and\or tabs, contains a known string and ends with a variable number of spaces and\or tabs and then a slash
Line to find:
xxx9.lib \
Then replace part of the string (9) with (9_1) and insert it after the orignal string with the same leading spaces and\or tabs.
Result:
xxx9.lib \
xxx9_1.lib \
Any help would be apperciated, particularlly around the replacement part.
find, copy, replace then insert -- help needed
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
I'll use _ to mark a space in the search expression. The _ in the replacement is a real _ ;-)
Line beginning: ^
variable number of spaces or tabs, even zero: [_\t]*
Backslash (needs to be escaped, otherwise it would escape the following character!): \\
Line end: $
you want to keep some parts so remember them by putting () around them
in the replace value use \1, \2, \3 ... for the remembered parts
This will result in
Search for:
Replace by
Line beginning: ^
variable number of spaces or tabs, even zero: [_\t]*
Backslash (needs to be escaped, otherwise it would escape the following character!): \\
Line end: $
you want to keep some parts so remember them by putting () around them
in the replace value use \1, \2, \3 ... for the remembered parts
This will result in
Search for:
Code: Select all
^([_\t]*xxx9)(.lib[_\t]*\\)$
Code: Select all
\1_1\2
Last edited by MudGuard on Sat Jan 12, 2008 1:25 pm, edited 1 time in total.
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm