在以下示例中,有 3 个元素需要排序:
- "[aaa]" 和它下面的 4 行(总是 4 行)形成一个单元。
- "[kkk]" 和它下面的 4 行(总是 4 行)形成一个单元。
- "[zzz]" 和它下面的 4 行(总是 4 行)形成一个单元。
只有遵循这种模式的行组才应该被排序;"[aaa]" 之前和 "[zzz]" 的第 4 行之后的任何内容都必须保持不变。
从:
This sentence and everything above it should not be sorted.
[zzz]
some
random
text
here
[aaa]
bla
blo
blu
bli
[kkk]
1
44
2
88
And neither should this one and everything below it.
到:
This sentence and everything above it should not be sorted.
[aaa]
bla
blo
blu
bli
[kkk]
1
44
2
88
[zzz]
some
random
text
here
And neither should this one and everything below it.