Jelajahi Sumber

Lua: Ereg : matched group escapes must come before double dollar sign escapes

Justin Donaldson 9 tahun lalu
induk
melakukan
4144a009a6
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      std/lua/_std/EReg.hx

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

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