jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r888505 - /jakarta/oro/trunk/src/java/org/apache/oro/text/regex/Perl5Substitution.java
Date Tue, 08 Dec 2009 18:34:06 GMT
Author: dfs
Date: Tue Dec  8 18:34:05 2009
New Revision: 888505

URL: http://svn.apache.org/viewvc?rev=888505&view=rev
Log:
Permit substitution backreferences to be specified with braces for
disambiguation (e.g., s/(foo)bar/${1}123/) in response to enhancement
request:
  http://mail-archives.apache.org/mod_mbox/jakarta-oro-user/200912.mbox/%3CC73E01E3.1DDFD%25bldantes@comcast.net%3E

Modified:
    jakarta/oro/trunk/src/java/org/apache/oro/text/regex/Perl5Substitution.java

Modified: jakarta/oro/trunk/src/java/org/apache/oro/text/regex/Perl5Substitution.java
URL: http://svn.apache.org/viewvc/jakarta/oro/trunk/src/java/org/apache/oro/text/regex/Perl5Substitution.java?rev=888505&r1=888504&r2=888505&view=diff
==============================================================================
--- jakarta/oro/trunk/src/java/org/apache/oro/text/regex/Perl5Substitution.java (original)
+++ jakarta/oro/trunk/src/java/org/apache/oro/text/regex/Perl5Substitution.java Tue Dec  8
18:34:05 2009
@@ -165,7 +165,7 @@
   transient String _lastInterpolation;
 
   private static final boolean __isInterpolationCharacter(char ch) {
-    return (Character.isDigit(ch) || ch == '&');
+    return (Character.isDigit(ch) || ch == '&' || ch == '{');
   }
 
   private void __addElement(int value) {
@@ -220,12 +220,18 @@
 	    saveDigits = false;
 	    continue;
 	  }
-	}
+	} else if(c == '{') {
+          continue;
+        }
 
 	__addElement(posParam);
 	posParam = 0;
 	saveDigits = false;
-      } 
+
+        if(c == '}') {
+          continue;
+        }
+      }
 
       if ((c != '$' && c != '\\') || escapeMode) {
 	escapeMode = false;



---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org


Mime
View raw message