Tag and Split out all of a Characters Speech

For my upcoming novel, I would like to check all character dialogs to ensure that every character has a distinct and consistent style of speaking. For this, it would be perfect if somehow during writing I could tag or otherwise mark every part of direct speech as belonging to character X. And then there would be an option to compile out only those parts.

For example:

John says [john:]“Hey Alice, how have you been?”[/]
Looking at him, Alice replies [alice:]“Hey buddy. Not bad.”[/], to which after a while she adds [alice:]“And you?”[/]

“Hey Alice, how have you been?”

“Hey buddy. Not bad.”
“And you?”

So basically I want to be able to see all direct speech, sorted by the speaker. Imagine that I have one character who, for example, never uses a specific word that is otherwise common in the text. This would be a great way to ensure that I really didn’t miss one occasion. But the main reason is more complex, I want to make sure men speak like men and women like women, that young and old people speak in their distinctive ways, that education levels are discernible, etc. etc. – these things are not in one part of a characters speech, but only in the sum total.

Any way of accomplishing this with existing methods would also be very welcome. Note that I am looking for a dynamic solution - if I update the text, I should not have to go throught the whole process again (pressing a compile button is fine). That’s why I’m not even considering “solutions” like “go through the text and copy out every passage spoken by John into a seperate text”. That’s also why none of the similar topics already posted give an answer useable to me.

I would find this highly useful. Consistency in dialogue is something that I strive for. I hate when I’m reading over something I’ve written, and a character that’s typically very casual in speech suddenly begins speaking very formally, for no good reason. And when I run across such an error in my writing, my first instinct is to go and find other such mistakes. This tool would make finding and repairing those mistakes SO much easier.