durationtools.is_lilypond_duration_string

abjad.tools.durationtools.is_lilypond_duration_string.is_lilypond_duration_string(expr)[source]

New in version 2.0.

True when expr is a LilyPond duration string:

abjad> from abjad.tools import durationtools
abjad> durationtools.is_lilypond_duration_string('4.. * 1/2')
True

Otherwise false:

abjad> durationtools.is_lilypond_duration_string('foo')
False

The regex ^(1|2|4|8|16|32|64|128|\breve|\longa|\maxima)\s*(\.*)\s*(\*\s*(\d+(/\d+)?))?$ underlies this predicate.

Return boolean.

This Page