Return-Path: Delivered-To: apmail-jakarta-oro-dev-archive@apache.org Received: (qmail 34012 invoked from network); 29 Jan 2002 21:01:18 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 29 Jan 2002 21:01:18 -0000 Received: (qmail 3690 invoked by uid 97); 29 Jan 2002 21:01:21 -0000 Delivered-To: qmlist-jakarta-archive-oro-dev@jakarta.apache.org Received: (qmail 3674 invoked by uid 97); 29 Jan 2002 21:01:20 -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 3663 invoked from network); 29 Jan 2002 21:01:20 -0000 Message-Id: <200201292104.g0TL41M05144@yoda.savarese.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: "ORO Developers List" Subject: Re: special control characters In-reply-to: Your message of "Tue, 29 Jan 2002 18:06:20 GMT." <3C56E49C.22896B2D@Sun.COM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 29 Jan 2002 16:04:01 -0500 From: "Daniel F. Savarese" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N In message <3C56E49C.22896B2D@Sun.COM>, Michael Davey - Sun UK Support Engineer writes: >I am not sure I understand your response. Let's ignore \a, \b, \e and >\v for now. How does substitute() parse the input string? "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. daniel -- To unsubscribe, e-mail: For additional commands, e-mail: