I don´t use python that often and I´m kind of new to it. I have a lot af layers in a single folder and I need to merge all the layers that starts and ends with the same character. I´ve done it manually before but it takes too much time to select the layers one by one through the merge tool and I have tried to use python to do it semiautomated, with Listfeatureclasses and wildcards and then continue to merge them, but it was also timeconsuming. It also seems like a waste of time to do it "my way" every time there are new updates.
I have tried to find a solution to my problem online and I searched through forums, but I´ve found nothing yet (maybe I´m searching for the wrong things). Below is a printscreen of a small part of my folder, so there are many more layers starting with other characters than e and h. Can I somehow with python group them and merge those that have the same filetype and characters (not middle characters)?

If this question already exist with an answer please let me know 