Page 1 of 1

Find pattern, use result as replace in another find/Replace?

Posted: Wed Oct 10, 2012 4:26 am
by Xeven
I see there are subfilters. How can I set up a find and replace so that one Filter uses the result of another (parent?) filter as the replace text.

1. Find DM.+?>

Use result of Find 1 in Find 2. <Tag1> Replace with <Tag1> (RESULT OF FIRST FIND).

Seems like I should be able to do something like this. Is it possible?

Re: Find pattern, use result as replace in another find/Repl

Posted: Fri Oct 12, 2012 6:05 am
by DataMystic Support
Easy, please see attached:

Code: Select all

|--Restrict to each line in turn
|  |
|  |--Perl pattern [DM[^\r\n&;]+?>] with [$0]
|  |  |  [ ] Match case
|  |  |  [ ] Whole words only
|  |  |  [ ] Case sensitive replace
|  |  |  [ ] Prompt on replace
|  |  |  [ ] Skip prompt if identical
|  |  |  [ ] First only
|  |  |  [ ] Extract matches
|  |  |  Maximum text buffer size 4096
|  |  |  [ ] Maximum match (greedy)
|  |  |  [ ] Allow comments
|  |  |  [X] '.' matches newline
|  |  |  [ ] UTF-8 Support
|  |  |
|  |  +--Capture to variable @test
|  |      Reset: 0
|  |      
|  +--Perl pattern [<Tag1>] with [<Tag1> @test@]
|        [ ] Match case
|        [ ] Whole words only
|        [ ] Case sensitive replace
|        [X] Prompt on replace
|        [ ] Skip prompt if identical
|        [ ] First only
|        [ ] Extract matches
|        Maximum text buffer size 4096
|        [ ] Maximum match (greedy)
|        [ ] Allow comments
|        [X] '.' matches newline
|        [ ] UTF-8 Support