On Saturday, February 2, 2019 at 9:45:40 AM UTC-8, jgill wrote:
>
> I need to identify chord lines and non-chord lines so that I can style 
> them differently on a web page. Remember, I'm not just looking for [A-G] 
> but A7, Am, A#, A♭dim etc
>
>
Yep, it's tricky. This (https://regex101.com/r/xQ5vd6/4) works on your 
example text (surrounding chords with bold HTML tags) but will fail on any 
lyric line that begins with anything from A to G. And it doesn't handle the 
more complex chord designations (like flats).

Which would suggest the best approach would be a little Perl script you 
could access as a Text Filter in BBEdit that would just look at 
odd-numbered lines (assuming the chords are first in the selection) and add 
the HTML formatting where a chord is found, no doubt using several regexes, 
looking for the longer, more complex strings first.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <https://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to