Article View: comp.lang.tcl
Article #47Re: A behaviour of regexp I cannot understand
From: Olivier
Date: Wed, 14 Oct 2026 19:03
Date: Wed, 14 Oct 2026 19:03
24 lines
1657 bytes
1657 bytes
Erik Leunissen <elns@xs4all.nl> posted:
> On 10/14/26 17:05, Olivier wrote:
> > regexp -inline -all {\S+} "dum dummy a b c d c4"
>
> Did you mean to do:
>
> regexp -inline -all {\s+} "dum dummy a b c d c4"
>
> Note the lower case character "s".
>
> Erik Leunissen
Ah ! Thank you, your message makes me look (again) at the definition of \S with
an uppercase : \S <==> [^[:space:]] . I did not pay attention to the "^" wich means :
"If the list begins with “^”, it matches any single character (but see below) not from the rest of the list."
The behaviour is now obvious ! It was in the documentation, but I had in mind that "^"
was relative to the "beginning of", not that usage.
Thanks for your time,
Olivier.
Technical Details
Message-ID:
<1792004591-1108@newsgrouper.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mailReferences:
<1791990352-1108@newsgrouper.org> <9ba7d49d-d931-8d3e-159c-a76c9fe26100@xs4all.nl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail From: Olivier <user1108@newsgrouper.org.invalid> Newsgroups: comp.lang.tcl Subject: Re: A behaviour of regexp I cannot understand References: <1791990352-1108@newsgrouper.org> <9ba7d49d-d931-8d3e-159c-a76c9fe26100@xs4all.nl> Date: Wed, 14 Oct 2026 19:03:11 GMT Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <1792004591-1108@newsgrouper.org> Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user1108 Injection-Date: Wed, 14 Oct 2026 19:03:11 GMT User-Agent: Newsgrouper/0.9.0 Organization: tcltk@vivaldi.net