@@ -195,13 +195,16 @@ func Test_func_replace(t *testing.T) {
195195 test_xpath_eval (t , empty_example , `replace("abracadabra", "a", "")` , "brcdbr" )
196196 // The below xpath expressions is not supported yet
197197 //
198- //test_xpath_eval(t, empty_example, `replace("abracadabra", "a.*a", "*")`, "*")
199- //test_xpath_eval(t, empty_example, `replace("abracadabra", "a.*?a", "*")`, "*c*bra")
200- //test_xpath_eval(t, empty_example, `replace("abracadabra", ".*?", "$1")`, "*c*bra") // error, because the pattern matches the zero-length string
201- //test_xpath_eval(t, empty_example, `replace("AAAA", "A+", "b")`, "b")
202- //test_xpath_eval(t, empty_example, `replace("AAAA", "A+?", "b")`, "bbb")
203- //test_xpath_eval(t, empty_example, `replace("darted", "^(.*?)d(.*)$", "$1c$2")`, "carted")
204- //test_xpath_eval(t, empty_example, `replace("abracadabra", "a(.)", "a$1$1")`, "abbraccaddabbra")
198+ test_xpath_eval (t , empty_example , `replace("abracadabra", "a.*a", "*")` , "*" )
199+ test_xpath_eval (t , empty_example , `replace("abracadabra", "a.*?a", "*")` , "*c*bra" )
200+ // test_xpath_eval(t, empty_example, `replace("abracadabra", ".*?", "$1")`, "*c*bra") // error, because the pattern matches the zero-length string
201+ test_xpath_eval (t , empty_example , `replace("AAAA", "A+", "b")` , "b" )
202+ test_xpath_eval (t , empty_example , `replace("AAAA", "A+?", "b")` , "bbbb" )
203+ test_xpath_eval (t , empty_example , `replace("darted", "^(.*?)d(.*)$", "$1c$2")` , "carted" )
204+ test_xpath_eval (t , empty_example , `replace("abracadabra", "a(.)", "a$1$1")` , "abbraccaddabbra" )
205+ test_xpath_eval (t , empty_example , `replace("abcd", "(ab)|(a)", "[1=$1][2=$2]")` , "[1=ab][2=]cd" )
206+ test_xpath_eval (t , empty_example , `replace("1/1/c11/1", "(.*)/[^/]+$", "$1")` , "1/1/c11" )
207+ test_xpath_eval (t , empty_example , `replace("A/B/C/D/E/F/G/H/I/J/K/L", "([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/(.*)", "$1-$2-$3-$4-$5-$6-$7-$8-$9-$10")` , "A-B-C-D-E-F-G-H-I-J/K/L" )
205208}
206209
207210func Test_func_reverse (t * testing.T ) {
0 commit comments