This GREP search will find regular spaces, unbreakable spaces, and tabs -- these are the kinds that you might find in an imported document. Replace with nothing to get rid of 'em all. Be Warned that authors mis-use tabs and spaces all the time, for instance, to indent a new paragraph (use First Line Indent for that), or to format tables with (use Tables for that), or to manually attempt to align a sequence of numbers (use any ol' trick for that EXCEPT tabs or spaces).
The meaning of all this: locate Start of Paragraph, then find any sequence of Space, Tab, or Fixed Space, ad inifitum.
Using the Start of Paragraph marker instead of your suggestion "paragraph return" ensures the previous paragraph won't be touched (which, as you found, messes up the assigned styles because this hard return belongs to the preceding paragraph).
Why use the class instead of just ^\s+ for this? Does \s miss something, or find something it shouldn't?
Have you tried running the Find/Change By List script that is installed inthe samples? It fixes almost all of this stuff execpt the last extra blank paragraph in a Word file.
Peter, \s includes regular space, tabs, fixed spaces (both kinds), and also Thin, En, Em, Number, Punctuation spaces (which, typically, one would manually insert in ID and so probably would not need deleting) but also the paragraph return and the soft line break. So if you use "^\s+" you would remove all multiple hard returns as well, and while at times this might be useful, usually you wouldn't want to do that willy-nilly.
If you check the standard "Double Space to Single Space" GREP query [*], you can see that Adobe circumvented this by making a rather extensive list of all possible white space characters except for the Paragraph Return and Soft Line Break.
(To include all possible white space except for returns and line breaks you can write, somewhat shorter,
but perhaps the character set notation [..list of codes to find..] is easier for beginners to grasp.)
[*] The standard "Remove Trailing Whitespace" query removes all double hard returns as well.
I guess I missed that there was a GREP for "start of paragraph" That solves the problem! Search start para space then replace with nothing.
I suspected that was the answer. I, of course, think that empty paragraphs should be banished in favor of proper spacing so that wouldn't bother me, but I'm sure not everyone would agree. The Find/Change by list scritp removes them, too.