How to delete sentences starting with a lower case letter?

Posted by Ron on Stack Overflow See other posts from Stack Overflow or by Ron
Published on 2010-04-19T00:47:57Z Indexed on 2010/04/19 0:53 UTC
Read the original article Hit count: 315

Filed under:
|
|
|

Hello:

In the example below the following regex (".*?") was used to remove all dialogue first. The next step is to remove all remaining sentences starting with a lower case letter. Only sentences starting with an upper case letter should remain.

Example:

exclaimed Wade. Indeed, below them were villages, of crude huts made of timber and stone and mud. Rubble work walls, for they needed little shelter here, and the people were but savages.

asked Arcot, his voice a bit unsteady with suppressed excitement.

replied Morey without turning from his station at the window. Below them now, less than half a mile down on the patchwork of the Nile valley, men were standing, staring up, collecting in little groups, gesticulating toward the strange thing that had materialized in the air above them.

In the example above the following should be deleted only:

exclaimed Wade. asked Arcot, his voice a bit unsteady with suppressed excitement. replied Morey without turning from his station at the window.

A useful regex or simple Perl or python code is appreciated. I'm using version 7 of Textpipe.

Thanks.

© Stack Overflow or respective owner

Related posts about regex

Related posts about perl