From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1896 invoked by alias); 4 Aug 2005 20:57:53 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1885 invoked by uid 22791); 4 Aug 2005 20:57:49 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 04 Aug 2005 20:57:49 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1E0mmh-0005k8-5n for gdb-patches@sources.redhat.com; Thu, 04 Aug 2005 16:57:47 -0400 Date: Thu, 04 Aug 2005 20:57:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: Fully anchor mi_gdb_test expected results. Message-ID: <20050804205747.GA22030@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20050804025045.GC32108@white> <20050804041121.GB29482@nevyn.them.org> <20050804140937.GB4054@white> <20050804141750.GA11536@nevyn.them.org> <20050804142601.GC4054@white> <20050804143238.GA11996@nevyn.them.org> <20050804203704.GA4472@white> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050804203704.GA4472@white> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-08/txt/msg00072.txt.bz2 On Thu, Aug 04, 2005 at 04:37:04PM -0400, Bob Rossi wrote: > > proc string_to_regexp {str} { > > set result $str > > regsub -all {[]*+.|()^$\[]} $str {\\&} result > > return $result > > } > > This doesn't seem to work for the " character. > > Here's the input to string_to_regexp, > 555-break-insert -t "\"basics.c\":28" > > Here's the output, > 555-break-insert -t "\"basics\.c\":28" > > Here is what I need to pass the test (which I hand wrote), > -break-insert -t \"\\\\\"basics.c\\\\\":28\" > > It's a little odd. The quote needs to be escaped once, which makes > perfect sense to me. The \ char needs to be escaped with 3 back slashes, > to make a total of 4. This is a little odd to me. Is that what > string_to_regexp does? > > Any ideas? Replace this: regsub -all {[]*+.|()^$\[]} $str {\\&} result with this: regsub -all {[]*+.|()^$\[\\]} $str {\\&} result i.e. add two backslashes before the closing break. Then does it work? -- Daniel Jacobowitz CodeSourcery, LLC