diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-11-27 21:38:39 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-11-28 23:06:20 +1000 |
commit | 6c6a315bb5d422df3764d4bf508dc741ee4742bc (patch) | |
tree | 0289ce23afbde1f3e7544ab42b8957897dab544d /tests | |
parent | 60dfb023c4afa95047e0fa8db49830ccb46446b2 (diff) | |
download | jimtcl-6c6a315bb5d422df3764d4bf508dc741ee4742bc.zip jimtcl-6c6a315bb5d422df3764d4bf508dc741ee4742bc.tar.gz jimtcl-6c6a315bb5d422df3764d4bf508dc741ee4742bc.tar.bz2 |
Bug fix: regexp should not treat \n as |
Remove a "feature" in the built-in regexp, where
a newline in the pattern was treated as alternation, like |.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/regexp.test | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regexp.test b/tests/regexp.test index a198fc8..885e44c 100644 --- a/tests/regexp.test +++ b/tests/regexp.test @@ -640,6 +640,10 @@ test regexp-21.13 {multiple matches handle newlines} { regexp -all -inline -indices -line -- ^ "a\nb\nc" } {{0 -1} {2 1} {4 3}} +test regexp-21.14 {Literal newline in pattern} { + regexp -all -inline "\n(\[ \t\]+)" "\n\t\t# This is a test" +} "{\n\t\t} {\t\t}" + test regexp-22.1 {effect of caching} jim { set filedata {BEGIN_TABLE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END_TABLE} |