|
2005-01-15
| ||
| 03:35 | • Ticket [1102326fff] regexp a{0} provides incorrect results status still Clos... artifact: c1328727c1 user: dgp | |
| 03:35 | • Ticket [1102326fff]: 6 changes artifact: 44b9fe8eb6 user: dgp | |
| 03:35 | • Closed ticket [1102326fff]. artifact: 3f97bccb8a user: dgp | |
|
2005-01-14
| ||
| 21:31 | • Ticket [1102326fff]: 4 changes artifact: 97cc75d0d0 user: lvirden | |
| 13:26 | • New ticket [1102326fff]. artifact: 93665016d0 user: lvirden | |
regexp a{0} provides incorrect results
Closed / Invalid1102326fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2005-01-14 13:26:05
set pat1 {a{0}}
set pat2 {a{1}}
set pat3 {a{0,1}}
set string "xyz"
foreach i [list $pat1 $pat2 $pat3] {
puts "Does $string match $i? [expr [regexp --
$i $string] ? yes : no]"
}
set string "abc"
foreach i [list $pat1 $pat2 $pat3] {
puts "Does $string match $i? [expr [regexp --
$i $string] ? yes : no]"
}
The above code was expected to report that in the first
loop, a yes, then two nos and in the second loop, one
no then two yeses.
On sparc solaris with 8.4.8 (and 8.5a2), I get this
instead:
$ ./tclsh8.4 /tmp/testre
Does xyz match a{0}? yes
Does xyz match a{1}? no
Does xyz match a{0,1}? yes
Does abc match a{0}? yes
Does abc match a{1}? yes
Does abc match a{0,1}? yes
lvirdenplain2005-01-14 21:31:10
Logged In: YES user_id=15949 Doesn't work for me even using tclkits and ActiveTcl's tclsh, so it isn't the build of the software . I don't have a Solaris 9 machine to try things on. Note that the concept of the report is conceptually the same as a discussion thread currently going on comp.lang.tcl , where someone else from another platform and site reports similar problems.
dgp Closed ticket [1102326fff].
[History diff]2005-01-15 03:35:37
dgpplain2005-01-15 03:35:38
Logged In: YES
user_id=80530
Those results look correct to me.
Keep in mind that the empty
string is a substring of every
string, and the patterns a{0}
and a{0,1} match the empty string.
dgp Ticket [1102326fff]: 2 changes
[History diff]2005-01-15 03:35:39
Log in (anonymous is fine) to add a comment.