From ae7f1d16601d654f5eb2c924def2a8ef8822763d Mon Sep 17 00:00:00 2001 From: rupa Date: Thu, 9 Aug 2012 14:48:53 -0400 Subject: [PATCH] another fix to the stupid regex escaping. This one works in gawk as well as mawk, and let's hope it works in the other bazillion flavors of awk as well. :/ --- z.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/z.sh b/z.sh index 848e408..48c4ed6 100755 --- a/z.sh +++ b/z.sh @@ -142,7 +142,7 @@ _z() { if( short == "/" ) return # escape regex chars in right hand side - gsub(/[\(\)\[\]\|]/, "\\\&", short) + gsub(/[\(\)\[\]\|]/, "\\\\&", short) # shortest match must be common to each match for( i in matches ) if( matches[i] && i !~ short ) return