// shorthand tonal notation (with quality after number)
var TONAL = '([-+]?)(\\d+)(d{1,4}|m|M|P|A{1,4}|b{1,4}|#{1,4}|)'
// strict shorthand notation (with quality before number)
var STRICT = '(AA|A|P|M|m|d|dd)([-+]?)(\\d+)'
var COMPOSE = '(?:(' + TONAL + ')|(' + STRICT + '))'
/**
* A regex for parse intervals in shorthand notation
*
* Three different shorthand notations are supported:
*
* - default [direction][number][quality]: the preferred style `3M`, `-5A`
* - strict: [quality][direction][number], for example: `M3`, `A-5`
* - altered: [direction][number][alterations]: `3`, `-5#`
*
* @name interval.regex
*/
module.exports = new RegExp('^' + COMPOSE + '$')
|