I tend to go for an easy repetitive solution for problems like this, rather
than wasting brain power trying to find a closed-form solution. Thus, replace
(>.*) (.*<) (open paren, greater than, dot, star, close paren,
space, open paren, dot, star, less than, close paren)
with
\1 \2
This will fix the first space in the title. Repeat until nothing more gets
replaced. Done.
Cheap and ugly, but it works.
Cheers,
Neil Faiman
> On Jun 26, 2024, at 12:24 PM, [email protected] <[email protected]> wrote:
>
> Hi all,
>
> Longtime fan, first time caller. BBEdit's the best.
>
> I know my way around BBEdit grep searches pretty well, and yet I'm finding
> myself stumped on what seems like it should be a pretty simple thing.
>
> I've got a bunch of lines that contain hyperlinks to song titles. In
> simplified form, they look like this:
>
> <a href='index.html#All Day Long'>All Day Long</a>
> <a href='index.html#Chosen Time'>Chosen Time</a>
> <a href='index.html#Sooner Than You Think'>Sooner Than You Think</a>
>
> I chose these specific examples because they have a variable number of spaces
> within the song names. What I want to do is replace the spaces in the
> displayed text (that is, between the ">" and the "<") with " " but I
> want to not do the same to the spaces within the href= portion of the <a tag.
>
> I can search with something like:
> >.*?</a>
> and that will match only the portion I want to change.
>
> Or if it helped, I could chunk the whole line into subpatterns, like:
> ^(<a.*?)(#.*?>)(.*?)(</a>)
> which would then put what I want to change in \3.
>
> But in either case, what would I put in the Replace field that would allow me
> to replace only the spaces with something else (" " in this case)? Or,
> is there some strategy for breaking it up into multiple finds that would get
> the job done? I've really racked my brain for a while on this and I feel like
> I must be staring at it but not seeing it.
>
> Thanks for any ideas!
>
> Ivan.
>
>
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or believe that the application isn't working correctly, please email
> "[email protected]" rather than posting here. Follow @bbedit on Mastodon:
> <https://mastodon.social/@bbedit>
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/d47cdc83-c4c0-4b75-aef3-f7eaed42e442n%40googlegroups.com
>
> <https://groups.google.com/d/msgid/bbedit/d47cdc83-c4c0-4b75-aef3-f7eaed42e442n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
This is the BBEdit Talk public discussion group. If you have a feature request
or believe that the application isn't working correctly, please email
"[email protected]" rather than posting here. Follow @bbedit on Mastodon:
<https://mastodon.social/@bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/4BE7F910-39F0-4273-BF92-96DCB4E5E746%40faiman.org.