Quote:
Originally Posted by Pippo53s03
Can you suggest a regular expression for truncating paragraphs longer than 1000 characters? it doesn't matter if blank spaces are included in calculation or not.
thanks! 
|
Hmmm, I'm not sure but maybe this can help you:
Find: (.{999})([^ ]+)(\s)(.)
Replace: \1\2</p>\n\n<p>\4
The above will find any string of 1000 chars and a few chars more until to find an space (because I suppose you won't want to split the paragraph in the middle of a word). But first you must select the text where you want to do the S&R (otherwise the regex will work also in the header of the .xhtml file) or don't select the "wrap" option, set the pointer after the body tag and do the S&R in the current file.
EDIT: If you want to find any string of 1000 chars plus a few more chars until to find a ". " (that would mean the end of a sentence) then use the following:
Find: (.{999})([^ ]+)(\.\s)(.)
Replace: \1\2.</p>\n\n<p>\4