BBEdit 10.5.9 (3370):

I had no trouble with

Search-grep:
<title>\r(.*?), (.*?) - (.*?)\r</title>

(Note 1: this is sensitive to getting your delimiters exactly right, and you'll 
also capture the leading and trailing space in \1 and \3, but I assume you know 
that, and can live with it.)

(Note 2: While it's easy to capture literal line breaks with copy/paste or 
cmd-E, you'd ordinarily use \r or \n. Those symbols are commonly used for ASCII 
13 and 10, but BBEdit's searches treat them as equivalent to any line break.)

Replacement:
<title>\r\1 - \3\r</title>

In an HTML file containing

<title>
Millennium, hand - shrimp
</title>

this resulted in

<title>
Millennium - shrimp
</title>

Strangely, the first time I tried this, \1 and \3 yielded literal "(.*?)". The 
search/replace worked after I fooled around with the patterns, but I don't 
remember exactly what I did. After a couple of decades' experience, I'd have 
thought the original patterns were not that far off.

Off the wall, are the apparent spaces and hyphen, in either pattern, or in your 
test document, the regular ASCII characters that look like that? No em/en 
dashes? No nonbreak spaces? I assume not, if you've made many experiments.

        -- F

On 2 Apr 2014, at 11:09 AM, Gregory Wiest <[email protected]> wrote:

> Hello,
> 
> I've been subscribed to this list for a long time, and even though I can't 
> say that I have read all of the posts, I am glad that I do occasionally read 
> them.  At the risk of repeating something that has already been dealt with or 
> of being caught at overlooking something very obvious, I would like to ask 
> for help with a problem I have recently come across in an attempt to use grep.
> 
> Grep doesn't process 
> 
> <title>
> (.*?), (.*?) - (.*?) 
> </title>
> 
> using
> 
> <title>
> \1 - \3 
> </title>
> 
> or any of the variations, that have occurred to me.
> 
> The BBEdit error message reads:  This operation couldn't be completed, 
> because an error occurred:  (MacOS Error code: -1701)
> 
> The error in Console reads
> 
> BBEdit[2832]: dynamic_cast error 2: One or more of the following type_info's  
> has hidden visibility.  They should all have public visibility.   9MAEWindow, 
> 20CSearchResultsWindow, 7CWindow.
> 
> My pattern will find what I want, but will not apply my conversion.
> 
> Googling has brought no solution.  The subject doesn't show up in the BBEdit 
> Talk archives.  I am using BBEedit 10.5.9 on an iMac running 10.9.2.  Any 
> ideas?  
> 
> Gregory Wiest
> gregorywiest.de
> 
> 
> 
> 
> 
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. 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>
> 
> --- 
> 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 post to this group, send email to [email protected].

-- 
This is the BBEdit Talk public discussion group. 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>

--- 
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 post to this group, send email to [email protected].

Reply via email to