Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Is a computer language with goto's totally Wirth-less?


devel / comp.lang.tcl / Re: possible "regsub/regexp" bug

SubjectAuthor
* possible "regsub/regexp" bugclt.to.davebr
`- Re: possible "regsub/regexp" bugSchelte

1
possible "regsub/regexp" bug

<5511656606513@dlp>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19610&group=comp.lang.tcl#19610

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: clt.to.davebr@dfgh.net
Newsgroups: comp.lang.tcl
Subject: possible "regsub/regexp" bug
Date: Thu, 30 Jun 22 16:28:33 GMT
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <5511656606513@dlp>
Injection-Info: reader01.eternal-september.org; posting-host="f51b7e611a4cf2fdf0541b87073f95d4";
logging-data="2068318"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18D5updPwcKtNTl/kdufrDz"
Cancel-Lock: sha1:aF3801ZNN0oZAC6nrKe7x4Ckp6k=
 by: clt.to.davebr@dfgh.net - Thu, 30 Jun 2022 16:28 UTC

>That's because you repeatedly reprocess the result of the previous
>substitution. The online regexp does the processing in one go. If you do
>the same with regsub, you get the requested result:
>
> regsub -all {(?!\()([A-Z][a-z]+)(?!\))} $match {(?:\1)?} match
>

Why are the (?!\() bits necessary?

regsub -all {([A-Z][a-z]+) $match {(?:\1)?}

seems to work

Dave B

Re: possible "regsub/regexp" bug

<nnd$158bf555$59368e76@b848bc428642887d>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19612&group=comp.lang.tcl#19612

  copy link   Newsgroups: comp.lang.tcl
Date: Thu, 30 Jun 2022 21:01:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.0
Subject: Re: possible "regsub/regexp" bug
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <5511656606513@dlp>
From: nospam@wanadoo.nl (Schelte)
In-Reply-To: <5511656606513@dlp>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <nnd$158bf555$59368e76@b848bc428642887d>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 18
Injection-Date: Thu, 30 Jun 2022 21:01:31 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1404
 by: Schelte - Thu, 30 Jun 2022 19:01 UTC

On 30/06/2022 18:28, clt.to.davebr@dfgh.net wrote:
>> That's because you repeatedly reprocess the result of the previous
>> substitution. The online regexp does the processing in one go. If you do
>> the same with regsub, you get the requested result:
>>
>> regsub -all {(?!\()([A-Z][a-z]+)(?!\))} $match {(?:\1)?} match
>>
>
> Why are the (?!\() bits necessary?
>
They're not. But I tend to change as little as possible from the
original code to focus on the problem at hand.

Why do you start a new thread, instead of following up in the existing one?

Schelte.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor