File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1690,6 +1690,14 @@ test "treplace":
16901690 check " aaa" .replace (re2 " a" , " b" , 1 ) == " baa"
16911691 check " Nim is awesome!" .replace (re2 " (\ w\B )" , " $1_" ) ==
16921692 " N_i_m i_s a_w_e_s_o_m_e!"
1693+ check " a" .replace (re2 " (a)|(b)" , " m($1)" ) == " m(a)"
1694+ check " a" .replace (re2 " (a)|(b)" , " m($2)" ) == " m()"
1695+ check " a" .replace (re2 " (b)|(a)" , " m($2)" ) == " m(a)"
1696+ check " a" .replace (re2 " (b)|(a)" , " m($1)" ) == " m()"
1697+ check " a" .replace (re2 " (a)|()" , " m($1)" ) == " m(a)m()"
1698+ check " a" .replace (re2 " (a)|()" , " m($2)" ) == " m()m()"
1699+ check " a" .replace (re2 " ()|(a)" , " m($2)" ) == " m()am()"
1700+ check " a" .replace (re2 " ()|(a)" , " m($1)" ) == " m()am()"
16931701
16941702 block :
16951703 proc by (m: RegexMatch2 , s: string ): string =
You can’t perform that action at this time.
0 commit comments