Browse Source

[lua] double-escape lua Ereg group match capture tokens

Justin Donaldson 8 years ago
parent
commit
0660953e69
1 changed files with 1 additions and 1 deletions
  1. 1 1
      std/lua/_std/EReg.hx

+ 1 - 1
std/lua/_std/EReg.hx

@@ -121,7 +121,7 @@ class EReg {
 	}
 	}
 
 
 	public function replace( s : String, by : String ) : String {
 	public function replace( s : String, by : String ) : String {
-		by = Rex.gsub(by, "\\$(\\d)", "%%1"); // convert dollar sign matched groups to Rex equivalent
+		by = Rex.gsub(by, "\\$(\\d)", "%%%1"); // convert dollar sign matched groups to Rex equivalent
 		by = Rex.gsub(by, "\\${2}", "$"); // escape double dollar signs
 		by = Rex.gsub(by, "\\${2}", "$"); // escape double dollar signs
 		return Rex.gsub(s,r,by, global ? null : 1);
 		return Rex.gsub(s,r,by, global ? null : 1);
 	}
 	}