Regex Extract in found order
Posted: 28.11.2022 11:21
Hello!
I love the ability to extract found matches, but I just realised that the result is sorted in alphabetical order.
I found this out while trying to match lines from different sections, like extracting all lines beginning on 1, and then lines beginning with 2 and so on.
Is there any way to get the result in the order it was matched?
Example
Say I have a document with this text;
1. XCY
2. BDZ
1. ABC
2. AAA
If I extract all lines beginning with 1, I expect the result:
1. XCY
1. ABC
Instead, I get this result:
1. ABC
1. XCY
I love the ability to extract found matches, but I just realised that the result is sorted in alphabetical order.
I found this out while trying to match lines from different sections, like extracting all lines beginning on 1, and then lines beginning with 2 and so on.
Is there any way to get the result in the order it was matched?
Example
Say I have a document with this text;
1. XCY
2. BDZ
1. ABC
2. AAA
If I extract all lines beginning with 1, I expect the result:
1. XCY
1. ABC
Instead, I get this result:
1. ABC
1. XCY