in reply to Sort text by Chapter names

In the real world, you must be prepared to allow chapter titles within the text.

Chapter One There were lots of monkeys here and they ate all the bananas (see 'ban +anas' in Chapter Two)... lots more text up to hundreds of words.

Probably the best you can do is to ignore titles that do not start at the beginning of a line.

Bill