If you have access to Linux or Cygwin on Windows, you can get it to tell you just about anything you want to know about your text with a few lines of shell code. Here's one approach.
Here's another article which explains the process in more detail.
In this case, you would probably first have to copy your text from its native format and then paste it without formatting into a text file so the internal formatting codes, etc. don't interfere with the logic.
The advantage of an approach like this is that, with a little effort, you can get your tool to report anything you want in exactly the format you want it in.
Microsoft is also talking about adding such shell capabilities into an upcoming release of Windows 10.
If you're on a Mac, you probably already have all of the necessary tools installed.