Unexpected result of copying multiple regex matches to clipboard

Viewed 62

I have a file that contains the following text:

<div class="a">
a
b
c
d
</div>
<div class="b">

</div>
<div class="a">
e
f
g
h
</div>

I go to Search > Find..., check Regular Expressions, then go to Advanced..., check the Regular Expression “.” Can Match Newline Characters option and set the number 12 as the value for Additional Lines to Search for Regular Expressions. Then I type

<div class="a".*?</div>

as the regular expression to match, click the Select All button (in the Find panel) and obtain two fragments of selected text. Then I click Edit > Copy. But when I create a new text file (in Emeditor) and paste the copied data in there, the result is

<div class="a">
a
b
c
d
<
<div class="a">
e
f
g
h
<

instead of the expected

<div class="a">
a
b
c
d
</div>
<div class="a">
e
f
g
h
</div>

What is the reason of this behavior and how to make Emeditor produce the expected result?

0 Answers
Related