Don't mean to drag this out, but I still am confused about the samples you have referenced. You are showing large blocks of data, two blocks, which one to use? I find it easier to work with sample data, then apply it to the real thing.
I am going to use a simple sample like this:
This is part of line one.
This is part of line two
and this is part of line two also.
This is part of line three.
This is part of line four
and this is part of line four also.
This works in TextPad:
Search for:
(.*)\n([a-z])
Replace with:
\1 \2 (note reverse slash from your example)
My earlier example also works in TextPad, a little easier:
Search for:
\n([a-z])
Replace with:
_\1 (Underscore "_" is for space character)
Both end up with this:
I am going to use a simple sample like this:
This is part of line one.
This is part of line two and this is part of line two also.
This is part of line three.
This is part of line four and this is part of line four also.
Both expressions do multiple lines in TextPad only because we have specified \n. But it will not handle \n+ or \n*, you need to specify the exact number of lines. That is what I meant by my comment. Their WildEdit product does scan multiple liines though. Any way, enough about TextPad. Let's get back to Macro Scheduler.....
This works fine in Macro Scheduler, based on my easier expression:
Code: Select all
Let>vHaystack=<P>This is part of line one.</P>%CRLF%<P>This is part of line two</P>%CRLF%<P>and this is part of line two also.</P>%CRLF%<P>This is part of line three.</P>%CRLF%<P>This is part of line four</P>%CRLF%<P>and this is part of line four also.</P>
Let>vNeedle=(?-i)</P>%CRLF%<P>([a-z])
Let>vReplacement=%space%$1
RegEx>%vNeedle%,%vHaystack%,0,vMatch,vMatchNumber,1,%vReplacement%,vResult
MessageModal>%vResult%
So, if this is hanging in Macro Scheduler I suspect that you need to make the Needle into a file and then do a ReadFile like this:
ReadFile>vNeedle
Make sure the line numbers are not included. My example is not using "\n" because the Macro Scheduler does not handle multiple lines in the Haystack. Must be put all on one line and use %CRLF%. But if this was in a file with multiple lines, you could replace the %CRLF% with \n in the Needle.
Hopefully this has made sense to you?