Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

One Bell System - it works.


devel / comp.lang.perl.misc / Re: bal() (was Re: regex)

SubjectAuthor
* bal() (was Re: regex)Otto J. Makela
`- Re: bal() (was Re: regex)Jim Gibson

1
bal() (was Re: regex)

<87lf8uhf7n.fsf_-_@tigger.extechop.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9961&group=comp.lang.perl.misc#9961

  copy link   Newsgroups: comp.lang.perl.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: om...@iki.fi (Otto J. Makela)
Newsgroups: comp.lang.perl.misc
Subject: bal() (was Re: regex)
Date: Tue, 04 May 2021 15:10:36 +0300
Organization: Games and Theory
Lines: 14
Message-ID: <87lf8uhf7n.fsf_-_@tigger.extechop.net>
References: <s4k0j2$1icm$1@gioia.aioe.org> <87h7ki71z5.fsf@bsb.me.uk>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="4adfc8e458c62df9ff215b4ec8fb5ab1";
logging-data="10333"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18L9sqpoza5E8XluGOpYpXS"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:1sMNgJTKU9FkbMhu2iqdWsSMOLQ=
sha1:dtZyXdbSzwfqQ0Fj3wb2U+8bgUE=
X-Face: 'g'S,X"!c;\pfvl4ljdcm?cDdk<-Z;`x5;YJPI-cs~D%;_<\V3!3GCims?a*;~u$<FYl@"E
c?3?_J+Zwn~{$8<iEy}EqIn_08"`oWuqO$#(5y3hGq8}BG#sag{BL)u8(c^Lu;*{8+'Z-k\?k09ILS
X-URL: http://www.iki.fi/om/
Mail-Copies-To: never
 by: Otto J. Makela - Tue, 4 May 2021 12:10 UTC

It would be nice to have bal() which was a pattern matching primitive
which matched balanced quote-like separators (including ones where you
had different left and right quotes, eg () or []). This was a standard
primitive in languages like Snobol4 and Icon, where the pattern matching
wasn't regex-derived.

Of course making an ersatz version in regex isn't impossible:

https://www.andrewzammit.com/blog/regexp-matching-balanced-parenthesis-and-quotes-greedy-non-recursive/
--
/* * * Otto J. Makela <om@iki.fi> * * * * * * * * * */
/* Phone: +358 40 765 5772, ICBM: N 60 10' E 24 55' */
/* Mail: Mechelininkatu 26 B 27, FI-00100 Helsinki */
/* * * Computers Rule 01001111 01001011 * * * * * * */

Re: bal() (was Re: regex)

<ifep7uF5tp5U1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9962&group=comp.lang.perl.misc#9962

  copy link   Newsgroups: comp.lang.perl.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: jimsgib...@gmail.com (Jim Gibson)
Newsgroups: comp.lang.perl.misc
Subject: Re: bal() (was Re: regex)
Date: 5 May 2021 05:37:02 GMT
Lines: 21
Message-ID: <ifep7uF5tp5U1@mid.individual.net>
References: <s4k0j2$1icm$1@gioia.aioe.org> <87h7ki71z5.fsf@bsb.me.uk> <87lf8uhf7n.fsf_-_@tigger.extechop.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 2Sh0TlaTvH5hpTNxgp8ydw49YML4GUWgGY1n+Mtoqo9dVUW+8E
Cancel-Lock: sha1:FI4bHEG0I9Owyps911KdqC0yEa4=
User-Agent: Usenapp/1.07.2/l for MacOS - Full License
 by: Jim Gibson - Wed, 5 May 2021 05:37 UTC

On May 4, 2021 at 5:10:36 AM PDT, "Otto J. Makela" <Otto J. Makela> wrote:

> It would be nice to have bal() which was a pattern matching primitive
> which matched balanced quote-like separators (including ones where you
> had different left and right quotes, eg () or []). This was a standard
> primitive in languages like Snobol4 and Icon, where the pattern matching
> wasn't regex-derived.
>
> Of course making an ersatz version in regex isn't impossible:
>
>
> https://www.andrewzammit.com/blog/regexp-matching-balanced-parenthesis-and-quotes-greedy-non-recursive/

There is a module for that:

https://metacpan.org/pod/Text::Balanced

--
Jim Gibson

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor