diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page
index 2fc447b2eba..3191234af0f 100755
--- a/Maintenance/test_handling/create_testresult_page
+++ b/Maintenance/test_handling/create_testresult_page
@@ -48,9 +48,10 @@ sub sort_releases($$)
my $b = $_[0];
my $a = $_[1];
- #take only the numbers from release id, skipping I and Ic
- my @A = ($a =~ /\d+/g);
- my @B = ($b =~ /\d+/g);
+ #take only the numbers from release id, skipping the bug-fix
+ #number, and I and Ic
+ my @A = ($a =~ /(\d+)\.(\d+)\.?(:?\d+)?(:?-Ic?-)?(\d+)?/a);
+ my @B = ($b =~ /(\d+)\.(\d+)\.?(:?\d+)?(:?-Ic?-)?(\d+)?/a);
while(@A and @B) {
my $av = shift(@A);
@@ -67,8 +68,8 @@ sub write_selects()
print OUTPUTV "
You can browse the test results of a different version :