Skip to content

Commit

Permalink
Robustify our tag regex a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Feb 18, 2011
1 parent 92e002a commit 3216e6e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions shared.php
Expand Up @@ -44,6 +44,11 @@
'/^(\d)-(\d)-(\d+)/' => '\1.\2.\3',
// 5 and later base transform
'/^(\d)-(\d+)/' => '\1.\2',
// And now lowercase all possible extra strings
'/UNSTABLE/' => 'unstable',
'/ALPHA/' => 'alpha',
'/BETA/' => 'beta',
'/RC/' => 'rc',
),
'tagmatch' => '/^DRUPAL-\d(-\d)?-\d+(-(\w+)(-)?(\d+)?)?$/',
),
Expand All @@ -64,11 +69,20 @@
// Strip DRUPAL- prefix.
'/^DRUPAL-/' => '',
// 4-7 and earlier base transform
'/^(\d)-(\d)--(\d+)-(\d+)/' => '\1.\2.x-\3.\4',
'/^(\d)-(\d)--(\d+)-(\d+)$/' => '\1.\2.x-\3.\4',
// Aggressively normalize post-version strings for 4-7 and earlier
'/^(\d)-(\d)--(\d+)-(\d+)(-)?([A-Za-z]+)(-)?(\d+)?$/' => '\1.\2.x-\3.\4-\6\8',
// 5 and later base transform
'/^(\d)--(\d+)-(\d+)/' => '\1.x-\2.\3',
'/^(\d)--(\d+)-(\d+)$/' => '\1.x-\2.\3',
// Aggressively normalize post-version strings for 5 and later
'/^(\d)--(\d+)-(\d+)(-)?([A-Za-z]+)(-)?(\d+)?$/' => '\1.x-\2.\3-\5\7',
// And now lowercase all possible extra strings
'/UNSTABLE/' => 'unstable',
'/ALPHA/' => 'alpha',
'/BETA/' => 'beta',
'/RC/' => 'rc',
),
'tagmatch' => '/^DRUPAL-\d(-\d)?--\d+-\d+(-(\w+)(-)?(\d+)?)?$/',
'tagmatch' => '/^DRUPAL-\d(-\d)?--\d+-\d+((-)?(\w+)(-)?(\d+)?)?$/',
),
);

Expand Down

0 comments on commit 3216e6e

Please sign in to comment.