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.