At 10:45 AM -0400 6/12/06, Morbus Iff wrote:
Thanks for that, did the job nicely, how does that grep pattern work?
I'm sure there's more documentation on this in the BBEdit manual,
but I'm too lazy to actually look so I'll give you pseudo
definitions based on strings from the Perl regular expressions
documentation ("perldoc perlre" in your shell).
Search for: (\w)\s+
-> ( ) = "anything inside the parenthesis is captured/remembered"
-> \w = a single word-like character. "A "\w" matches a single
alphanumeric character (an alphabetic character, or a
decimal digit) or "_", not a whole word."
-> \s+ = one or more whitespace characters.
Replace with: \1 <---- there's a single space after the \1
-> \1 = BBEdit syntax for "the first thing captured by the
parenthesis in the search regular expression".
-> " " = the space character that is invisible. basically,
since the \s+ above is NOT in the parenthesis (and
thus not in \1), we have to add the single space back.
Won't that pattern tend to remove newlines?
Why not just replace " +" with " "? (That is, space-space-plus with
space.) That is, replace any string of two or more spaces with a
single space.
--
/Jonathan Lundell.
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>