That is matching a bloc:
(south\r(([A-Z]\r)+)\r)
or
(north\r(([A-Z]\r)+)\r)
You can combine then in by :
Replace ((Partten1)*)((Partteen2)*) By \3\1 # (adjust number)
For example process many time
AAAABBBBAAAABBBBBAAABBB
With
replace ((B)*)((A)*) by \3\1
Another way is to transform a bloc into a single line, and to sort
lines (fix steps)
Replace \r([A-Z])$ by _\1
Sort lines,
Replace _([A-Z]) by \r\1