Hi everyone, and thanks for all of the suggestions.

As sometimes happens, just writing down the question, and reading some
suggestions, led me to re-think the problem. In fact I had almost
solved it, but had a special case that failed. It's a longish story
but it comes down to having an AppleScript that did a ton of text
processing via BBEdit, and Step 1 was to change certain text from
upper or mixed case to lower.

I'd already figured out how to skip the URLs, or so I thought-- but,
when I was faced with text that looked like THIS-AND-THAT my Step 1
(change to lower case) failed. I was asking here for a new way to
avoid changing the URLs, which sometimes have hyphens, when instead I
should have been looking at how I found the text that I wanted to
change.

What I found was that my "find what" was NOT finding text that had a
leading hyphen. It was finding text that had a leading space, or
carriage return, or period, etc.-- but not a leading hyphen. So,
rather than start over with a new method all I had to do was add "|(-
+)" to what I was looking for. A lot simpler than what I was trying to
do, which amounted to reinventing the whole thing. It is funny how it
all becomes clear, sometimes.

Anyhow, thank you. I learned a lot from your responses.

c

On May 23, 12:52 pm, Webmaster <[email protected]> wrote:
> At 7:24 AM -0700 on 5/22/11, ChristianBoyce wrote:
>
> >  Thanks for this. Now, how to tell BBEdit to leave
> >  everything that is between angle brackets alone? I know how to
> >  deal with the "greedy" matching-- but the problem is, I want to
> >  change everything that does NOT match.
> >  I can find <.*?>, but that's not what I want to change to lower
> >  case. I want to change everything else. Maybe I should look the
> >  other way around:
> >  .*?< and just do a special case for the top of the document.
> >  All of a sudden I think this is solving itself.
> >  c
>
> Christian, I no longer have the previous messages from this
> thread in my email client; so can you please provide me with
> a clear example -- angle brackets included -- so that I can
> see exactly what it is that you are trying to accomplish.
>
> Show me what it should look like before applying grep, and
> what it should look like after applying grep.
>
> I am still quite new at using grep patterns myself, but I
> will try to help. There are a number of grep gurus here who
> are much more experienced with this kind of stuff than I am.
> In fact, even the little I understand now was learned from
> Patrick W. and others here, so I take no credit for it.  :)
>
> WW

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to