I do apologize, it was case #2 <g>. I should have mentioned that this
is in between text and not after linebreaks. Though got to thinking
that that might happen, so I'll keep note of the regex in case needed
down the road.
Also, all this is needed for cleaning up text snippets.
I made the most marvellous discovery yesterday. My text editor of
choice for years has been Metapad. I found out yesterday what the
"external viewers" option is in it. The external viewers are just 2
launchers possible from within Metapad. Once I found that out, I
assigned EmEditor, another text editor with macro capabilities, as
the "primary viewer" and a freeware spell checker as the second.
The text editor EmEditor has great macro command abilities which can
also use regex.
Firefox has an extension (plugin) that allows us to save text snippets
off of webpages.
So, with this regex command here (which works pretty wonderfully so
far, btw), I'll select text in Firefox and send to Metapad with the
extension by the easy mouse clicks of selecting text and right-
clicking on a special context entry. Metapad pops up with my selected
web text. I click on the primary viewer and the EmEditor pops up with
text dumped into it automagically <g>. A click of a toolbar button
pointing to the clean-up macro and the text gets cleaned up of all the
gunk can be in the html to text "translation" and the I save and close
EmEditor. Metapad in the background comes back to the fore and a
simple refresh [F5] and the text is updated with the EmEditor cleaned
up text. So in a series of mouse clicks I now have almost perfectly
cleaned up text done in a couple of seconds rather than me doing it
all by hand, as I have for years.
But formatting varies on the web, as people know. Your regex S&R of:
Then you look for
\s*\.{5,}\s*
and replace with " ... "
works like a charm! It cleaned up all but one case, the case where
the format is like this, something I hadn't thought of.
-------------------------------------------------------------------------
This actual test text:
hello ... how ......... are ................. you ......
dkidkeij...fdksdkfjdlskjfle ..............
fdskfjldsakfjalseiaelfj............dasflkdslafjksalkfslakf ...........................................................
test test...dfjslkjf
gets changed to this with the above regex:
hello ... how ... are ... you ... dkidkeij...fdksdkfjdlskjfle ...
fdskfjldsakfjalseiaelfj ... dasflkdslafjksalkfslakf ... test
test...dfjslkjf
-------------------------------------------------------------------------
The only one not fixed is when there is no spacing at all between the
text and periods. The number of periods seems to get fixed so far to
just three, but the spacing isn't corrected in between. So
"xxxx...xxxx" doesn't get changed to "xxxx ... xxxx".
How can this slight addition be accommodated for, anyone know?
Periods stump me because they're part of regex command in themselves.
<g>.
Thanks!! :)