Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
([ABCDEFG](?!\h{1}[a-zA-Z][a-z]+))(#|##|b|bb)?(maj|min|M|m|sus)?(aug|dim|ø)?([0-9][0-9]?)?(alt)?(#|##|b|bb)?([0-9])?([\),-]?\s+|[\/])
/
g

Description

Match chords from songsheets

Submitted by code26 - 9 years ago