I guess the problem is beyond me, but for testing different regexen just use something like this:
[example] Sort Lines With Pattern.kmmacros (2.7 KB)
This will
- not alter your system clipboard
- no need of a Prompt
- to run it just hit the Try button or ⇧⌘T