Format Genre as First Letter of Album Artist

I might can figure this out, but it would be great if someone could point me in the right direction. Ive tried searching the forum (both through google and the built in search).

I use my Genre field to organize my tracks by the first letter of the usually the artist.

If the artist is not a letter of the alphabet it needs to be formatted as a '#' sign. Need to skip omit 'the' from the formatting also.

I am guessing i need to look into regex?

This is kinda working:

$ifgreater($len(%ARTIST%),$len($regexp(%ARTIST%,'^[^[:alpha:]]',)),'#',$upper($left(%ARTIST%,1)))

I just need to figure out how to make it exclude 'The'

$regexp($upper($regexp(%artist%,'^\sThe\s+(.).$|^(.).$|^($)','$1$2$3')),'[:alpha:]','#')
Use following if you really want to extend the leading articles to be excluded.
$regexp($upper($regexp(%artist%,'^\s
(?:(?:(?:In|On|At)\s)?(?:A|An|The))\s+(.).$|^(.).$|^($)','$1$2$3')),'[:alpha:]','#')

Thanks. That works!