os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/regexp.test
First public contribution.
1 # Commands covered: regexp, regsub
3 # This file contains a collection of tests for one or more of the Tcl
4 # built-in commands. Sourcing this file into Tcl runs the tests and
5 # generates output for errors. No output means no errors were found.
7 # Copyright (c) 1991-1993 The Regents of the University of California.
8 # Copyright (c) 1998 Sun Microsystems, Inc.
9 # Copyright (c) 1998-1999 by Scriptics Corporation.
11 # See the file "license.terms" for information on usage and redistribution
12 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 # RCS: @(#) $Id: regexp.test,v 1.22.2.3 2003/10/14 18:22:10 vincentdarley Exp $
16 if {[lsearch [namespace children] ::tcltest] == -1} {
17 package require tcltest 2
18 namespace import -force ::tcltest::*
22 test regexp-1.1 {basic regexp operation} {
25 test regexp-1.2 {basic regexp operation} {
28 test regexp-1.3 {basic regexp operation} {
31 test regexp-1.4 {basic regexp operation} {
32 regexp -- -gorp abc-gorpxxx
34 test regexp-1.5 {basic regexp operation} {
35 regexp {^([^ ]*)[ ]*([^ ]*)} "" a
37 test regexp-1.6 {basic regexp operation} {
38 list [catch {regexp {} abc} msg] $msg
40 test regexp-1.7 {regexp utf compliance} {
41 # if not UTF-8 aware, result is "0 1"
43 regexp "\u4e4eb q" "a\u4e4eb qw\u5e4e\x4e wq" bar
44 list [string compare $foo $bar] [regexp 4 $bar]
47 test regexp-2.1 {getting substrings back from regexp} {
49 list [regexp ab*c abbbbc foo] $foo
51 test regexp-2.2 {getting substrings back from regexp} {
54 list [regexp a(b*)c abbbbc foo f2] $foo $f2
56 test regexp-2.3 {getting substrings back from regexp} {
59 list [regexp a(b*)(c) abbbbc foo f2] $foo $f2
61 test regexp-2.4 {getting substrings back from regexp} {
65 list [regexp a(b*)(c) abbbbc foo f2 f3] $foo $f2 $f3
67 test regexp-2.5 {getting substrings back from regexp} {
68 set foo {}; set f1 {}; set f2 {}; set f3 {}; set f4 {}; set f5 {};
69 set f6 {}; set f7 {}; set f8 {}; set f9 {}; set fa {}; set fb {};
70 list [regexp (1*)(2*)(3*)(4*)(5*)(6*)(7*)(8*)(9*)(a*)(b*) \
71 12223345556789999aabbb \
72 foo f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb] $foo $f1 $f2 $f3 $f4 $f5 \
73 $f6 $f7 $f8 $f9 $fa $fb
74 } {1 12223345556789999aabbb 1 222 33 4 555 6 7 8 9999 aa bbb}
75 test regexp-2.6 {getting substrings back from regexp} {
76 set foo 2; set f2 2; set f3 2; set f4 2
77 list [regexp (a)(b)? xay foo f2 f3 f4] $foo $f2 $f3 $f4
79 test regexp-2.7 {getting substrings back from regexp} {
80 set foo 1; set f2 1; set f3 1; set f4 1
81 list [regexp (a)(b)?(c) xacy foo f2 f3 f4] $foo $f2 $f3 $f4
83 test regexp-2.8 {getting substrings back from regexp} {
85 list [regexp {^a*b} aaaab match] $match
87 test regexp-2.9 {getting substrings back from regexp} {
90 list [regexp f\352te(b*)c f\352tebbbbc foo f2] $foo $f2
91 } [list 1 f\352tebbbbc bbbb]
92 test regexp-2.10 {getting substrings back from regexp} {
95 list [regexp f\352te(b*)c eff\352tebbbbc foo f2] $foo $f2
96 } [list 1 f\352tebbbbc bbbb]
98 test regexp-3.1 {-indices option to regexp} {
100 list [regexp -indices ab*c abbbbc foo] $foo
102 test regexp-3.2 {-indices option to regexp} {
105 list [regexp -indices a(b*)c abbbbc foo f2] $foo $f2
107 test regexp-3.3 {-indices option to regexp} {
110 list [regexp -indices a(b*)(c) abbbbc foo f2] $foo $f2
112 test regexp-3.4 {-indices option to regexp} {
116 list [regexp -indices a(b*)(c) abbbbc foo f2 f3] $foo $f2 $f3
117 } {1 {0 5} {1 4} {5 5}}
118 test regexp-3.5 {-indices option to regexp} {
119 set foo {}; set f1 {}; set f2 {}; set f3 {}; set f4 {}; set f5 {};
120 set f6 {}; set f7 {}; set f8 {}; set f9 {}
121 list [regexp -indices (1*)(2*)(3*)(4*)(5*)(6*)(7*)(8*)(9*) \
123 foo f1 f2 f3 f4 f5 f6 f7 f8 f9] $foo $f1 $f2 $f3 $f4 $f5 \
125 } {1 {0 16} {0 0} {1 3} {4 5} {6 6} {7 9} {10 10} {11 11} {12 12} {13 16}}
126 test regexp-3.6 {getting substrings back from regexp} {
127 set foo 2; set f2 2; set f3 2; set f4 2
128 list [regexp -indices (a)(b)? xay foo f2 f3 f4] $foo $f2 $f3 $f4
129 } {1 {1 1} {1 1} {-1 -1} {-1 -1}}
130 test regexp-3.7 {getting substrings back from regexp} {
131 set foo 1; set f2 1; set f3 1; set f4 1
132 list [regexp -indices (a)(b)?(c) xacy foo f2 f3 f4] $foo $f2 $f3 $f4
133 } {1 {1 2} {1 1} {-1 -1} {2 2}}
135 test regexp-4.1 {-nocase option to regexp} {
136 regexp -nocase foo abcFOo
138 test regexp-4.2 {-nocase option to regexp} {
142 list [regexp -nocase {a(b*)([xy]*)z} aBbbxYXxxZ22 f1 f2 f3] $f1 $f2 $f3
143 } {1 aBbbxYXxxZ Bbb xYXxx}
144 test regexp-4.3 {-nocase option to regexp} {
145 regexp -nocase FOo abcFOo
147 set x abcdefghijklmnopqrstuvwxyz1234567890
148 set x $x$x$x$x$x$x$x$x$x$x$x$x
149 test regexp-4.4 {case conversion in regexp} {
150 list [regexp -nocase $x $x foo] $foo
154 test regexp-5.1 {exercise cache of compiled expressions} {
162 test regexp-5.2 {exercise cache of compiled expressions} {
170 test regexp-5.3 {exercise cache of compiled expressions} {
178 test regexp-5.4 {exercise cache of compiled expressions} {
186 test regexp-5.5 {exercise cache of compiled expressions} {
195 test regexp-6.1 {regexp errors} {
196 list [catch {regexp a} msg] $msg
197 } {1 {wrong # args: should be "regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"}}
198 test regexp-6.2 {regexp errors} {
199 list [catch {regexp -nocase a} msg] $msg
200 } {1 {wrong # args: should be "regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"}}
201 test regexp-6.3 {regexp errors} {
202 list [catch {regexp -gorp a} msg] $msg
203 } {1 {bad switch "-gorp": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --}}
204 test regexp-6.4 {regexp errors} {
205 list [catch {regexp a( b} msg] $msg
206 } {1 {couldn't compile regular expression pattern: parentheses () not balanced}}
207 test regexp-6.5 {regexp errors} {
208 list [catch {regexp a( b} msg] $msg
209 } {1 {couldn't compile regular expression pattern: parentheses () not balanced}}
210 test regexp-6.6 {regexp errors} {
211 list [catch {regexp a a f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1} msg] $msg
213 test regexp-6.7 {regexp errors} {
214 list [catch {regexp (x)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.) xyzzy} msg] $msg
216 test regexp-6.8 {regexp errors} {
219 list [catch {regexp abc abc f1(f2)} msg] $msg
220 } {1 {couldn't set variable "f1(f2)"}}
221 test regexp-6.9 {regexp errors, -start bad int check} {
222 list [catch {regexp -start bogus {^$} {}} msg] $msg
223 } {1 {expected integer but got "bogus"}}
225 test regexp-7.1 {basic regsub operation} {
226 list [regsub aa+ xaxaaaxaa 111&222 foo] $foo
227 } {1 xax111aaa222xaa}
228 test regexp-7.2 {basic regsub operation} {
229 list [regsub aa+ aaaxaa &111 foo] $foo
231 test regexp-7.3 {basic regsub operation} {
232 list [regsub aa+ xaxaaa 111& foo] $foo
234 test regexp-7.4 {basic regsub operation} {
235 list [regsub aa+ aaa 11&2&333 foo] $foo
237 test regexp-7.5 {basic regsub operation} {
238 list [regsub aa+ xaxaaaxaa &2&333 foo] $foo
239 } {1 xaxaaa2aaa333xaa}
240 test regexp-7.6 {basic regsub operation} {
241 list [regsub aa+ xaxaaaxaa 1&22& foo] $foo
242 } {1 xax1aaa22aaaxaa}
243 test regexp-7.7 {basic regsub operation} {
244 list [regsub a(a+) xaxaaaxaa {1\122\1} foo] $foo
246 test regexp-7.8 {basic regsub operation} {
247 list [regsub a(a+) xaxaaaxaa {1\\\122\1} foo] $foo
248 } "1 {xax1\\aa22aaxaa}"
249 test regexp-7.9 {basic regsub operation} {
250 list [regsub a(a+) xaxaaaxaa {1\\122\1} foo] $foo
251 } "1 {xax1\\122aaxaa}"
252 test regexp-7.10 {basic regsub operation} {
253 list [regsub a(a+) xaxaaaxaa {1\\&\1} foo] $foo
254 } "1 {xax1\\aaaaaxaa}"
255 test regexp-7.11 {basic regsub operation} {
256 list [regsub a(a+) xaxaaaxaa {1\&\1} foo] $foo
258 test regexp-7.12 {basic regsub operation} {
259 list [regsub a(a+) xaxaaaxaa {\1\1\1\1&&} foo] $foo
260 } {1 xaxaaaaaaaaaaaaaaxaa}
261 test regexp-7.13 {basic regsub operation} {
263 list [regsub abc xyz 111 foo] $foo
265 test regexp-7.14 {basic regsub operation} {
267 list [regsub ^ xyz "111 " foo] $foo
269 test regexp-7.15 {basic regsub operation} {
271 list [regsub -- -foo abc-foodef "111 " foo] $foo
273 test regexp-7.16 {basic regsub operation} {
275 list [regsub x "" y foo] $foo
277 test regexp-7.17 {regsub utf compliance} {
278 # if not UTF-8 aware, result is "0 1"
279 set foo "xyz555ijka\u4e4ebpqr"
280 regsub a\u4e4eb xyza\u4e4ebijka\u4e4ebpqr 555 bar
281 list [string compare $foo $bar] [regexp 4 $bar]
284 test regexp-8.1 {case conversion in regsub} {
285 list [regsub -nocase a(a+) xaAAaAAay & foo] $foo
287 test regexp-8.2 {case conversion in regsub} {
288 list [regsub -nocase a(a+) xaAAaAAay & foo] $foo
290 test regexp-8.3 {case conversion in regsub} {
292 list [regsub a(a+) xaAAaAAay & foo] $foo
294 test regexp-8.4 {case conversion in regsub} {
296 list [regsub -nocase a CaDE b foo] $foo
298 test regexp-8.5 {case conversion in regsub} {
300 list [regsub -nocase XYZ CxYzD b foo] $foo
302 test regexp-8.6 {case conversion in regsub} {
303 set x abcdefghijklmnopqrstuvwxyz1234567890
304 set x $x$x$x$x$x$x$x$x$x$x$x$x
306 list [regsub -nocase $x $x b foo] $foo
309 test regexp-9.1 {-all option to regsub} {
311 list [regsub -all x+ axxxbxxcxdx |&| foo] $foo
312 } {4 a|xxx|b|xx|c|x|d|x|}
313 test regexp-9.2 {-all option to regsub} {
315 list [regsub -nocase -all x+ aXxXbxxcXdx |&| foo] $foo
316 } {4 a|XxX|b|xx|c|X|d|x|}
317 test regexp-9.3 {-all option to regsub} {
319 list [regsub x+ axxxbxxcxdx |&| foo] $foo
321 test regexp-9.4 {-all option to regsub} {
323 list [regsub -all bc axxxbxxcxdx |&| foo] $foo
325 test regexp-9.5 {-all option to regsub} {
327 list [regsub -all node "node node more" yy foo] $foo
329 test regexp-9.6 {-all option to regsub} {
331 list [regsub -all ^ xxx 123 foo] $foo
334 test regexp-10.1 {expanded syntax in regsub} {
336 list [regsub -expanded ". \#comment\n . \#comment2" abc def foo] $foo
338 test regexp-10.2 {newline sensitivity in regsub} {
340 list [regsub -line {^a.*b$} "dabc\naxyb\n" 123 foo] $foo
342 test regexp-10.3 {newline sensitivity in regsub} {
344 list [regsub -line {^a.*b$} "dabc\naxyb\nxb" 123 foo] $foo
345 } "1 {dabc\n123\nxb}"
346 test regexp-10.4 {partial newline sensitivity in regsub} {
348 list [regsub -lineanchor {^a.*b$} "da\naxyb\nxb" 123 foo] $foo
350 test regexp-10.5 {inverse partial newline sensitivity in regsub} {
352 list [regsub -linestop {a.*b} "da\nbaxyb\nxb" 123 foo] $foo
355 test regexp-11.1 {regsub errors} {
356 list [catch {regsub a b} msg] $msg
357 } {1 {wrong # args: should be "regsub ?switches? exp string subSpec ?varName?"}}
358 test regexp-11.2 {regsub errors} {
359 list [catch {regsub -nocase a b} msg] $msg
360 } {1 {wrong # args: should be "regsub ?switches? exp string subSpec ?varName?"}}
361 test regexp-11.3 {regsub errors} {
362 list [catch {regsub -nocase -all a b} msg] $msg
363 } {1 {wrong # args: should be "regsub ?switches? exp string subSpec ?varName?"}}
364 test regexp-11.4 {regsub errors} {
365 list [catch {regsub a b c d e f} msg] $msg
366 } {1 {wrong # args: should be "regsub ?switches? exp string subSpec ?varName?"}}
367 test regexp-11.5 {regsub errors} {
368 list [catch {regsub -gorp a b c} msg] $msg
369 } {1 {bad switch "-gorp": must be -all, -nocase, -expanded, -line, -linestop, -lineanchor, -start, or --}}
370 test regexp-11.6 {regsub errors} {
371 list [catch {regsub -nocase a( b c d} msg] $msg
372 } {1 {couldn't compile regular expression pattern: parentheses () not balanced}}
373 test regexp-11.7 {regsub errors} {
376 list [catch {regsub -nocase aaa aaa xxx f1(f2)} msg] $msg
377 } {1 {couldn't set variable "f1(f2)"}}
378 test regexp-11.8 {regsub errors, -start bad int check} {
379 list [catch {regsub -start bogus pattern string rep var} msg] $msg
380 } {1 {expected integer but got "bogus"}}
381 test regexp-11.9 {regsub without final variable name returns value} {
384 test regexp-11.10 {regsub without final variable name returns value} {
385 regsub -all a abaca X
387 test regexp-11.11 {regsub without final variable name returns value} {
388 regsub b(.*?)d abcdeabcfde {,&,\1,}
390 test regexp-11.12 {regsub without final variable name returns value} {
391 regsub -all b(.*?)d abcdeabcfde {,&,\1,}
392 } {a,bcd,c,ea,bcfd,cf,e}
394 # This test crashes on the Mac unless you increase the Stack Space to about 1
395 # Meg. This is probably bigger than most users want...
396 # 8.2.3 regexp reduced stack space requirements, but this should be
398 test regexp-12.1 {Tcl_RegExpExec: large number of subexpressions} {macCrash} {
399 list [regexp (.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.) abcdefghijklmnopqrstuvwxyz all a b c d e f g h i j k l m n o p q r s t u v w x y z] $all $a $b $c $d $e $f $g $h $i $j $k $l $m $n $o $p $q $r $s $t $u $v $w $x $y $z
400 } {1 abcdefghijklmnopqrstuvwxyz a b c d e f g h i j k l m n o p q r s t u v w x y z}
402 test regexp-13.1 {regsub of a very large string} {
403 # This test is designed to stress the memory subsystem in order
404 # to catch Bug #933. It only fails if the Tcl memory allocator
407 set line {BEGIN_TABLE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END_TABLE}
408 set filedata [string repeat $line 200]
409 for {set i 1} {$i<10} {incr i} {
410 regsub -all "BEGIN_TABLE " $filedata "" newfiledata
415 test regexp-14.1 {CompileRegexp: regexp cache} {
425 test regexp-14.2 {CompileRegexp: regexp cache, different flags} {
433 regexp -nocase $x bbba
436 testConstraint exec [llength [info commands exec]]
437 test regexp-14.3 {CompileRegexp: regexp cache, empty regexp and empty cache} -constraints {
440 set junk [makeFile {puts [regexp {} foo]} junk.tcl]
442 exec [interpreter] $junk
447 test regexp-15.1 {regexp -start} {
449 list [regexp -start -10 {\d} 1abc2de3 x] $x
451 test regexp-15.2 {regexp -start} {
453 list [regexp -start 2 {\d} 1abc2de3 x] $x
455 test regexp-15.3 {regexp -start} {
457 list [regexp -start 4 {\d} 1abc2de3 x] $x
459 test regexp-15.4 {regexp -start} {
461 list [regexp -start 5 {\d} 1abc2de3 x] $x
463 test regexp-15.5 {regexp -start, over end of string} {
465 list [regexp -start [string length 1abc2de3] {\d} 1abc2de3 x] [info exists x]
467 test regexp-15.6 {regexp -start, loss of ^$ behavior} {
468 list [regexp -start 2 {^$} {}]
471 test regexp-16.1 {regsub -start} {
473 list [regsub -all -start 2 {\d} a1b2c3d4e5 {/&} x] $x
475 test regexp-16.2 {regsub -start} {
477 list [regsub -all -start -25 {z} hello {/&} x] $x
479 test regexp-16.3 {regsub -start} {
481 list [regsub -all -start 3 {z} hello {/&} x] $x
483 test regexp-16.4 {regsub -start, \A behavior} {
485 lappend out [regsub -start 0 -all {\A(\w)} {abcde} {/\1} x] $x
486 lappend out [regsub -start 2 -all {\A(\w)} {abcde} {/\1} x] $x
487 } {5 /a/b/c/d/e 3 ab/c/d/e}
489 test regexp-17.1 {regexp -inline} {
490 regexp -inline b ababa
492 test regexp-17.2 {regexp -inline} {
493 regexp -inline (b) ababa
495 test regexp-17.3 {regexp -inline -indices} {
496 regexp -inline -indices (b) ababa
498 test regexp-17.4 {regexp -inline} {
499 regexp -inline {\w(\d+)\w} " hello 23 there456def "
501 test regexp-17.5 {regexp -inline no matches} {
502 regexp -inline {\w(\d+)\w} ""
504 test regexp-17.6 {regexp -inline no matches} {
505 regexp -inline hello goodbye
507 test regexp-17.7 {regexp -inline, no matchvars allowed} {
508 list [catch {regexp -inline b abc match} msg] $msg
509 } {1 {regexp match variables not allowed when using -inline}}
511 test regexp-18.1 {regexp -all} {
514 test regexp-18.2 {regexp -all} {
515 regexp -all b abababbabaaaaaaaaaab
517 test regexp-18.3 {regexp -all -inline} {
518 regexp -all -inline b abababbabaaaaaaaaaab
520 test regexp-18.4 {regexp -all -inline} {
521 regexp -all -inline {\w(\w)} abcdefg
523 test regexp-18.5 {regexp -all -inline} {
524 regexp -all -inline {\w(\w)$} abcdefg
526 test regexp-18.6 {regexp -all -inline} {
527 regexp -all -inline {\d+} 10:20:30:40
529 test regexp-18.7 {regexp -all -inline} {
530 list [catch {regexp -all -inline b abc match} msg] $msg
531 } {1 {regexp match variables not allowed when using -inline}}
532 test regexp-18.8 {regexp -all} {
533 # This should not cause an infinite loop
534 regexp -all -inline {a*} a
536 test regexp-18.9 {regexp -all} {
537 # Yes, the expected result is {a {}}. Here's why:
538 # Start at index 0; a* matches the "a" there then stops.
539 # Go to index 1; a* matches the lambda (or {}) there then stops. Recall
540 # that a* matches zero or more "a"'s; thus it matches the string "b", as
541 # there are zero or more "a"'s there.
542 # Go to index 2; this is past the end of the string, so stop.
543 regexp -all -inline {a*} ab
545 test regexp-18.10 {regexp -all} {
546 # Yes, the expected result is {a {} a}. Here's why:
547 # Start at index 0; a* matches the "a" there then stops.
548 # Go to index 1; a* matches the lambda (or {}) there then stops. Recall
549 # that a* matches zero or more "a"'s; thus it matches the string "b", as
550 # there are zero or more "a"'s there.
551 # Go to index 2; a* matches the "a" there then stops.
552 # Go to index 3; this is past the end of the string, so stop.
553 regexp -all -inline {a*} aba
555 test regexp-18.11 {regexp -all} {
556 regexp -all -inline {^a} aaaa
558 test regexp-18.12 {regexp -all -inline -indices} {
559 regexp -all -inline -indices a(b(c)d|e(f)g)h abcdhaefgh
560 } {{0 4} {1 3} {2 2} {-1 -1} {5 9} {6 8} {-1 -1} {7 7}}
562 test regexp-19.1 {regsub null replacement} {
563 regsub -all {@} {@hel@lo@} "\0a\0" result
564 list $result [string length $result]
565 } "\0a\0hel\0a\0lo\0a\0 14"
567 test regexp-20.1 {regsub shared object shimmering} {
569 set a abcdefghijklmnopqurstuvwxyz
571 set c abcdefghijklmnopqurstuvwxyz0123456789
573 list $d [string length $d] [string bytelength $d]
574 } [list abcdefghijklmnopqurstuvwxyz0123456789 37 37]
575 test regexp-20.2 {regsub shared object shimmering with -about} {
576 eval regexp -about abc
579 test regexp-21.1 {regsub works with empty string} {
583 test regexp-21.2 {regsub works with empty string} {
587 test regexp-21.3 {regsub works with empty string offset} {
588 regsub -start 0 -- ^ {} foo
591 test regexp-21.4 {regsub works with empty string offset} {
592 regsub -start 0 -- \$ {} foo
595 test regexp-21.5 {regsub works with empty string offset} {
596 regsub -start 3 -- \$ {123} foo
599 test regexp-21.6 {regexp works with empty string} {
603 test regexp-21.7 {regexp works with empty string} {
604 regexp -start 0 -- ^ {}
607 test regexp-21.8 {regexp works with empty string offset} {
608 regexp -start 3 -- ^ {123}
611 test regexp-21.9 {regexp works with empty string offset} {
612 regexp -start 3 -- \$ {123}
615 test regexp-21.10 {multiple matches handle newlines} {
616 regsub -all -lineanchor -- {^#[^\n]*\n} "#one\n#two\n#three\n" foo\n
619 test regexp-21.11 {multiple matches handle newlines} {
620 regsub -all -line -- ^ "a\nb\nc" \#
623 test regexp-21.12 {multiple matches handle newlines} {
624 regsub -all -line -- ^ "\n\n" \#
627 test regexp-21.13 {multiple matches handle newlines} {
628 regexp -all -inline -indices -line -- ^ "a\nb\nc"
629 } {{0 -1} {2 1} {4 3}}
632 ::tcltest::cleanupTests