Title |
Test
Find
Musical chords in online chord sheets
|
Expression |
(?<=(\s|-|\/|\\|\())([A-G][b#]?[m]?((6\/9|11|13|[679]))?((dim|dom|aug|sus|min|maj|add|no|m|M|-|\+)(11|13|15|[23456789])?){0,2}([b#\-\+][59]){0,2}(\/[A-G][b#]?)?)(?=(\s|-|\/|\\|\)|$)) |
Description |
I crafted this crazy regex for matching chords in song sheets you find online. It matches a ton of different combinations, including some very weird/advanced chords like double suspended and chords with extra flats/sharps.
The whole matching part is enclosed in parentheses so I can quickly find chords in a document and wrap them with square brackets. |
Matches |
A|Ab7#9b5|G#6/9|C#sus2sus4|C6+G|Cm/G |
Non-Matches |
Dm/9|Aadd9aug13m6|min|Abs |
Author |
Rating:
Steve Blair
|
Source |
|
Your Rating |
|