f



regsub in tcl 8.5 and 8.6

parse this row
set a "123(qwe)"

in tcl 8.6
# regsub -all "\\(.*" $a ""
123qwe)

in tcl 8.5
# regsub -all "\\(.*" $a ""
123

What to do ?
0
UTF
9/8/2014 6:13:08 AM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

7 Replies
789 Views

Similar Articles

[PageSpeed] 59

Thank you for the report.
Confirmed with 8.5.16 and 8.6.2
Aparently, 8.6 is not as greedy as 8.5.

I don't know if this is a bug or a feature.
Could you please register a bug report at:
core.tcl.tk/tcl
-> Login as anonymous
-> New ticket

The most important people don't read clt but read bug reports...

Thank you,
Harald
0
Harald
9/8/2014 6:38:36 AM
0L/QvtC90LXQtNC10LvRjNC90LjQuiwgOCDRgdC10L3RgtGP0LHRgNGPIDIwMTTCoNCzLiwgOTox
MzoxMiBVVEMrMyDQv9C+0LvRjNC30L7QstCw0YLQtdC70Ywg0K3QtNGD0LDRgNC0INCX0L7Qt9GD
0LvRjyDQvdCw0L/QuNGB0LDQuzoNCj4gcGFyc2UgdGhpcyByb3cNCj4gDQo+IHNldCBhICIxMjMo
cXdlKSINCj4gDQo+IA0KPiANCj4gaW4gdGNsIDguNg0KPiANCj4gIyByZWdzdWIgLWFsbCAiXFwo
LioiICRhICIiDQo+IA0KPiAxMjNxd2UpDQo+IA0KPiANCj4gDQo+IGluIHRjbCA4LjUNCj4gDQo+
ICMgcmVnc3ViIC1hbGwgIlxcKC4qIiAkYSAiIg0KPiANCj4gMTIzDQo+IA0KPiANCj4gDQo+IFdo
YXQgdG8gZG8gPw0KDQpkZWNpZGVkIHRvIHVzZSByZW5hbWU6DQotLS0tLQ0KcmVuYW1lIHJlZ3N1
YiByZWdzdWJfb2xkDQpwcm9jIHJlZ3N1YiB7IGFyZ3MgfQ0KICBldmFsIHJlZ3N1Yl9vbGQgLWV4
cGFuZGVkICRhcmdzDQp9DQotLS0tLQ0KDQpCdXQsIGdldCBlcnJvcjoNCmNhbid0IHVuc2V0ICJk
dW1teSI6IG5vdCBzdWNoIHZhcmlhYmxlDQoNCg==
0
UTF
9/8/2014 6:51:25 AM
On 08/09/2014 07:13, Эдуард Зозуля wrote:
> parse this row
> set a "123(qwe)"
>
> in tcl 8.6
> # regsub -all "\\(.*" $a ""
> 123qwe)
>
> in tcl 8.5
> # regsub -all "\\(.*" $a ""
> 123
>
> What to do ?

That's definitely a bug, and it is related to the -all option in
[regsub] and how things are compiled to bytecode. The engine itself has
no problem.

   % regexp -inline "\\(.*" $a
   (qwe)
   % tcl::unsupported::disassemble script {regsub -all "\\(.*" $a ""}
   ByteCode 0x0x10304a410, refCt 1, epoch 15, interp 0x0x100829a10 
(epoch 15)
     Source "regsub -all \"\\(.*\" $a \"\""
     Cmds 1, src 25, inst 9, litObjs 3, aux 0, stkDepth 3, code/src 0.00
     Commands 1:
         1: pc 0-7, src 0-24
     Command 1: "regsub -all \"\\(.*\" $a \"\""
       (0) push1 0 	# "("
       (2) push1 1 	# ""
       (4) push1 2 	# "a"
       (6) loadStk
       (7) strmap
       (8) done

Conversion to a [string map]? I don't think that's possibly right! (The
problem is that the condition used for conversion here is right for
[string match] but not [string map]. Ugh.)

Have you filed a bug report yet? This one's serious. Also, removing the
-all option will work fine in this case; it's never actually useful with
a trailing “.*” in the pattern.

Donal.
-- 
Donal Fellows — Tcl user, Tcl maintainer, TIP editor.
0
Donal
9/8/2014 6:53:22 AM
0L/QvtC90LXQtNC10LvRjNC90LjQuiwgOCDRgdC10L3RgtGP0LHRgNGPIDIwMTTCoNCzLiwgOTo1
MzoyMyBVVEMrMyDQv9C+0LvRjNC30L7QstCw0YLQtdC70YwgRG9uYWwgSy4gRmVsbG93cyDQvdCw
0L/QuNGB0LDQuzoNCj4gSGF2ZSB5b3UgZmlsZWQgYSBidWcgcmVwb3J0IHlldD8gVGhpcyBvbmUn
cyBzZXJpb3VzLiANCj4NCj4gRG9uYWwuDQo+IA0KPiAtLSANCj4gDQo+IERvbmFsIEZlbGxvd3Mg
4oCUIFRjbCB1c2VyLCBUY2wgbWFpbnRhaW5lciwgVElQIGVkaXRvci4NCg0KTm8uDQpGb3IgcmVn
aXN0cmF0aW9uIG9uIGh0dHA6Ly9jb3JlLnRjbC50ay90Y2wvcmVnaXN0ZXINCkkgZ2V0IGVycm9y
OiAiVGhlIGNvbm5lY3Rpb24gd2FzIHJlc2V0Ig0K
0
UTF
9/8/2014 7:04:57 AM
Sorry for the inconvenience with the ticket system. Its a pitty that we loose information due to that...

Donal,
thank you for the quick reaction and analysis.
Could you file the ticket ?
At least you have understood a bit what is happening...

Thank you,
Harald
0
Harald
9/8/2014 7:48:03 AM
?????? ?????? <ed.zozulya@gmail.com> wrote:
> parse this row
> set a "123(qwe)"

> in tcl 8.6
> # regsub -all "\\(.*" $a ""
> 123qwe)

> in tcl 8.5
> # regsub -all "\\(.*" $a ""
> 123

> What to do ?

  % set tcl_patchLevel
  8.6.1
  % set a "123(qwe)"
  123(qwe)
  % regsub -all {[(].*} $a ""
  123
  % 

I'm assuming you want the 8.5 result in 8.6.

0
Rich
9/8/2014 10:54:29 AM
Yes, Rich, that would be the correct answer for a greedy operator.

As there was still no ticket and sun is rising also over the US, here is the ticket:

https://core.tcl.tk/tcl/tktview/84af1192f514f190a1d14f31394ced8b6816e633

"It is better to know bad news ;-)"

Thank you all,
Harald
0
Harald
9/8/2014 12:06:30 PM
Reply:

Similar Artilces:

Bug789040 came back in Tcl 8.4.6 and Tcl 8.5.
Dear All, Bug 789040 caused exec error in Windows 9x and was fixed in 10/04/03. But it came back in Tcl 8.4.6 and Tcl 8.5. Tcl Windows 9x users should be alerted to the possible failure of exec in the current Tcl 8.4.6 and 8.5 releases due to this bug. Chengye Mao http://www.geocities.com/~chengye Chengye Mao wrote: > Bug 789040 caused exec error in Windows 9x and was fixed in 10/04/03. > But it came back in Tcl 8.4.6 and Tcl 8.5. Tcl Windows 9x users > should be alerted to the possible failure of exec in the current Tcl > 8.4.6 and 8.5 releases due to this bug. Have you i...

Binary reader speed comparison
I have a fairly simple binary reader proc that exhibits massive speed differences between Tcl 8.5.8 and Tcl8.6b1.1. Here's the proc: proc readFormatted {filename} { set fd [ open $filename r ] fconfigure $fd -encoding binary -translation binary binary scan [ read $fd 2 ] cc type nextlen if {$type != 75} { return -error "File is not in the expected format" } while {![append buffer [read $fd $nextlen] ; eof $fd]} { binary scan [read $fd 2] cc lastlen nextlen # convert to unsigned value set nextlen ...

Question on migration from TCL 8.3 to TCL 8.6
Hi All, I am working on a EDA tool which is built on TCL 8.3 platform. I need to upgrade the platform to TCL 8.6. Is it proper to move directly from 8.3 to 8.6 version? Or should I upgrade to TCL 8.5 as TCL 8.6 is still beta version. Please suggest me precautions. Please point me to documentation/User guide related to this. Thanks for help, Divyesh On Thursday, 30 January 2014 04:47:57 UTC, Divyesh Patel wrote: > Is it proper to move directly from 8.3 to 8.6 version? Or should I upgrade to TCL 8.5 as TCL 8.6 is still beta version. > Tcl 8.6.1 is now the current ...

tcl 8.4 to 8.5
Hi all, I've been using tcl 8.4.19 for ages, but just got moved to 8.5.11 at work, and now a lot of my scripts fail. For instance, I use: "package require aes" but this gets thrown out by 8.5 I need an idiots guide to upgrading, anyone help please? On 05/21/2013 01:25 PM, nivparsons wrote: > I've been using tcl 8.4.19 for ages, but just got > moved to 8.5.11 at work, and now a lot of my scripts fail. > > For instance, I use: > > "package require aes" > > but this gets thrown out by 8.5 Are your packages installed ...

"::tcl::tm::UnknownHandler ::tclPkgUnknown msgcat 1.4" caused by replacing Tcl 8.4.1 with 8.5.7
In the blog http://planet.larrythecow.org/archives/2009-07-26.html "The Twouble with Tcl" Iain Buchanan shows that redefining OPEN proc leads to the errors similar to what I am getting - when I replaced Tcl 8.4.1 with Tcl 8.5.7. In my case I don't know the exact root cause though ... Any ideas how I should proceed with debugging this issue ? Thanks, Alex tclsh c:/Tornado/host/resource/hutils/tcl/makeSymTbl.tcl ppc tmp.o symTbl.c invalid command name "::tcl::tm::UnknownHandler" while executing "::tcl::tm::UnknownHandler ::tclPkgUnknown msg...

Tcl/Tk 8.5.8 RELEASED
Tcl/Tk 8.5.8 Release Announcement November 16, 2009 The Tcl Core Team is pleased to announce the 8.5.8 releases of the Tcl dynamic language and the Tk toolkit. This is the eighth patch release of Tcl/Tk 8.5. More details can be found below. We would like to express our gratitude to all those who submit bug reports and patches. This information is invaluable in enabling us to identify and eliminate problems in the core. Where to get the new releases: ------------------------------ Tcl/Tk 8.5.8 sources are freely available as open source from the Tcl Developer Xchange web site at: ...

Tcl 8.4 vs 8.5
This is OK in 8.5: expect1.3> set a {1 2 3} 1 2 3 expect1.4> expr {[lindex $a 1] in {2 3 4}} 1 But not OK in 8.4: expect1.8> set a {1 2 3} 1 2 3 expect1.10> expr {[lindex $a 1] in {2 3 4}} syntax error in expression "[lindex $a 1] in {2 3 4}": extra tokens at end of expression while compiling "expr {[lindex $a 1] in {2 3 4}}" Is there a way to make the expression backward compatible in 8.4? /WT On Feb 5, 10:16=A0pm, Why Tea <ytl...@gmail.com> wrote: > This is OK in 8.5: > expect1.3> set a =A0{1 2 3} > 1 2 3 > expect1.4> expr {[li...

tcl 8.5/8.4 difference
Hi TCLers, I've found a strange behaviour in Tcl 8.5.7 and 8.5.5 (vs. 8.4.19) when working with Pgtcl (pgaccess.tcl). The effected code line is (after a successfull database select): pg_result $pgres -assign curr_tabs The variable $pgres contains the correct handle (e.g. "pgsql6.0"), but Tcl 8.5 crashes with the message: Tcl_SetIntObj called with shared object whereas Tcl 8.4 continues without any error. I know that it is hard to analyze this problem without code, examples, .... but maybe the error behaviour brings some 1st idea where to start the search. I will inv...

Crash on Exit in Tcl 8.5.8
Hi I just upgraded my app from Tcl8.5.7 to Tcl8.5.8 on windows and am facing a crash when I type exit on windows. I have traced this down to the extra code added in tclObj.c ----------------------- /* * We cannot use TclGetContinuationTable() here, because that may * re-initialize the thread-data for calls coming after the * finalization. We have to access it using the low-level call and then * check for validity. This function can be called after * TclFinalizeThreadData() has already killed the thread-global data * structures. Performing TCL_TSD...

ANNOUNCE: freeWrap 8.6 released (supports TCL/TK 8.6.0)
This message announces the availability of freeWrap version 6.6. FreeWrap 6.6 is based on TCL/TK 8.6.0 freeWrap is a program that allows creation of stand-alone TCL/TK executables without needing a compiler. Versions are free and available for the Windows and Linux operating systems. Instructions and source code for building freeWrap are also available. The following additional variation of freeWrap is also available for download: freewrapTCLSH a console-only application which includes only TCL. Please visit the freeWrap home page: http://freewrap....

Upgrade perl from 5.8.6 to 5.8.8
Hi all, Perl N00b here in need of a bit of kind assistance! I am attempting to upgrade Perl from 5.8.6 to 5.8.8 on Fedora Core 4 I have performed the following: Run: perl -V to get the version (5.8.6) Downloaded perl version 5.8.8 and untarred Run: ./Configure -des -Uusethreads Run: make Run: make test Run: make install All goes well - how do i alter my installation to now use this version of perl, as running perl -V returns the same version information? Many thanks for any help! Ben <ben.wilder@gmail.com> wrote in comp.lang.perl.misc: > Hi all, > > Perl N00b here in ...

Tcl 8.6, ActiveTcl 8.6 & linux Fedora 16 (64 bit)...
Hi all, Just a quick note about installing ActiveTcl 8.6 under Fedora 16, 64 bit. Downloading ActiveTcl 8.6 and trying to run the installer, fails. The reason is that libXss.so, is missing from the system, and Tk seems to need this. The problem can be "resolved" by installing the package "libXScrnSaver". But there is no such package for Fedora 16, and (thankfully) the package gets installed from Fedora 15. Maybe this is a "sign" that libXss.so will disappear in the (near?) future... George PS: Also the mysql TDBC driver crashes, as the shared library has ...

tcl 8.3.5 test fails on SunOS 5.8 with --disable-shared --enable-gcc
Hello, Any ideas on why these tests fails. Thanks in advance ... $ uname -a SunOS atlas 5.8 Generic_108528-07 sun4u sparc ==== clock-9.1 %s gmt testing FAILED ==== Contents of test case: # We need PST to guarantee the difference value below. set s 100000 set a [clock format $s -format %s -gmt 0] set b [clock format $s -format %s -gmt 1] # This should be the offset in seconds between current locale and GMT. # This didn't seem to be correctly on Windows until the fix for # Bug #559376, which fiddled with env(TZ) when -gmt 1 was used. # It's hard-coded...

Tcl OO mixins and inheritence behaviour change from version 8.6.2 to version 8.6.3
Hi, it seems that implementation of object oriented functionality in tcl8.6.3 changed in a away that breaks my existing code. My test code looks like this: oo::class create MixinClass { method helloWorld {args} { puts "[self class]" catch { next } } } oo::class create BaseClass { mixin MixinClass method helloWorld {args} { puts "[self class]" catch { next } } } oo::class create TargetClass { superclass BaseClass method helloWorld {args} { puts "[self class]" catch { next } } }...

Web resources about - regsub in tcl 8.5 and 8.6 - comp.lang.tcl

Tweaking the Varnish Cache
... vmod. In the vcl_hash function, which defines our hash key, we can write: import boltsort ; sub vcl_hash { hash_data ( boltsort.sort ( regsuball ...

Graphical Applications with Tcl and Tk
foster-johnson.com Home About Me My Books My Weblog Java Web Development Tcl Perl Python Linux X Window System Shell Scripting RPM , Second Edition ...

Tweaking the Varnish Cache
... vmod. In the vcl_hash function, which defines our hash key, we can write: import boltsort ; sub vcl_hash { hash_data ( boltsort.sort ( regsuball ...


Speed Up Your Mobile Website With Varnish
... analytics cookies, you could add the following. sub vcl_recv { // Remove has_js and Google Analytics __* cookies. set req.http.Cookie = re ...

Observe Yourself…
Install GeopIp module for Nginx. Five simple steps and you are done. Get country, city and other geo related info about the website visitors. ...

PostgreSQL Regular Expression Operator and Functions
Complete explanation of PostgreSQL's regular expression operator and functions, and the regular expression flavors they support

Tcl Commands
Tcl8.5.15/Tk8.5.15 Documentation > Tcl Commands Tcl/Tk Applications - Tcl Commands - Tk Commands - Tcl Library - Tk Library after error lappend ...

References and redirects to 461
wiki.tcl.tk References and redirects to Regular Expression Date Name Who What 2014-06-11 22:06:55 * AMG@97.65.37.226 reference 2012-01-11 15:32:25 ...

Tcl regexp and regsub - Regular Expressions in Tcl
Learn how to use regular expressions with Tcl's regexp and regsub commands

Resources last updated: 1/26/2016 1:08:37 PM