Return-Path: Delivered-To: apmail-jakarta-oro-dev-archive@apache.org Received: (qmail 3942 invoked from network); 30 Jan 2002 09:22:58 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Jan 2002 09:22:58 -0000 Received: (qmail 22160 invoked by uid 97); 30 Jan 2002 09:23:06 -0000 Delivered-To: qmlist-jakarta-archive-oro-dev@jakarta.apache.org Received: (qmail 22117 invoked by uid 97); 30 Jan 2002 09:23:05 -0000 Mailing-List: contact oro-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "ORO Developers List" Reply-To: "ORO Developers List" Delivered-To: mailing list oro-dev@jakarta.apache.org Received: (qmail 22106 invoked from network); 30 Jan 2002 09:23:05 -0000 Sender: michaed@sr-egmp02-02.uk.sun.com Message-ID: <3C57BB80.67AF41B9@Sun.COM> Date: Wed, 30 Jan 2002 09:23:12 +0000 From: Michael Davey - Sun UK Support Engineer Reply-To: michael.davey@Sun.COM Organization: Sun Microsystems - Enterprise Services http://sunsolve.sun.co.uk/ X-Mailer: Mozilla 4.76C-Netscape [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: ORO Developers List Subject: Re: special control characters References: <200201292104.g0TL41M05144@yoda.savarese.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N "Daniel F. Savarese" wrote: > "s/foo/bar/" is split up into its components first, taking into account > any escaped delimiters. > foo is a regular expression, so Perl5Compiler compiles the expression > if it is not already cached. Therefore all Perl escapes are handled. > bar is the replacement string and is therefore not touched by Perl5Compiler. > If it contains nothing that needs special treatment, it is a handled > by a StringSubstitution (i.e., a normal Java string included verbatim). > If it contains something special, it is handled by Perl5Substitution, so > any group interpolations (e.g., $1, $2) are processed and also the case > modification escapes (\u\U\e\E). The case modification escapes used > to not be handled because they are a part of normal Perl string > processing and were considered out of scope. But Mark made a convincing > argument to include them and provided a patch to boot, so they are now > handled. > > The gist of it is that if you use "\\t" in the replacement string it is > a vanilla Java string and treated as '\' followed by 't', so you would use > "\t" if you really wanted a tab to be substituted. Okay, I think that what you are saying (reading between the lines) is that the substitution and replacement strings are parsed, but the input that we search on is not parsed. If this is the case, would it make sense to add a parser for the input string? The input parser would parse the control characters and escape sequences listed on page 40 of Programming Perl, 2nd Ed. -- Michael -- To unsubscribe, e-mail: For additional commands, e-mail: