# file : tests/regex/testscript # license : MIT; see accompanying LICENSE file : replace-search : { $* abcbd b x >axcxd : all $* -ffo abcbd b x >axcbd : first-only $* -fnc abcbd b x >xx : no-copy : ecma-escape : { $* xay a '$b' >'x$by' : none $* xay a '$' >'x$y' : none-term $* xay a '$$' >'x$y' : self $* xay a 'b$&c' >'xbacy' : match $* xay a 'b$`c' >'xbxcy' : match-precede $* xay a "b\\\$'c" >'xbycy' : match-follow : capture : { $* abcdefghij '(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)' '$1$10' >aj : matched $* a '(a)|(b)' '$1$2$3' >a : unmatched } } : perl-escape : { $* xay a '\b' >'xby' : none $* xay a '\' >'xy' : none-term $* xay a '\\' >'x\y' : self : newline : $* xay a '\n' >>EOO x y EOO : capture : { $* abcdefghij '(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)' '\1\10' >aa0 : matched $* a '(a)|(b)' '\1\2\3' >a : unmatched } : upper : { $* xay a '\U' >xy : none $* xay a '\Uvz' >xVZy : repl $* xay a '\Uv\Ez' >xVzy : end $* aa a 'v\Uz' >vZvZ : locality $* xay '(a)' '\U\1' >xAy : capt $* x-y '(a?)-' '\U\1z' >xZy : capt-empty $* xay a '\uvz' >xVzy : once } : lower : $* xay a '\lVZ' >xvZy } } : replace-match : { test.options += -m $* abc 'a(b)c' 'x\1y' >xby : match $* abcd 'a(b)c' 'x\1yd' == 1 : no-match }