Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38114

Re: regex replaceAll?

Path csiph.com!weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!news.albasani.net!.POSTED!not-for-mail
From Kiwi User <martin@mydomain.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: regex replaceAll?
Date Sat, 3 Mar 2018 20:07:48 +0000 (UTC)
Organization albasani.net
Lines 30
Message-ID <p7evak$2c2$1@news.albasani.net> (permalink)
References <4a800440-39fe-4684-8369-e6a4e6b9d79f@googlegroups.com> <slrnp9gjk6.5mg.avl@logic.at> <44c665e1-e965-4e9b-8aa0-72aa20607e63@googlegroups.com> <slrnp9gtn0.5mg.avl@logic.at> <8c677118-8115-409d-8d3b-396e54b063ae@googlegroups.com> <slrnp9gvpc.5mg.avl@logic.at> <p7a6n9$tal$1@news.albasani.net> <p7a72k$qqd$1@gioia.aioe.org> <p7a9ke$tal$2@news.albasani.net> <p7c3fe$2qs$1@gioia.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace news.albasani.net nOtSr/v13Me5TJ07TThSRsNecJZurzjgXMt/KEsmyDZ8Z5ZaKB0N2vexGMTTe9isr/f6qmWfCQrMufQRBPzxDw==
NNTP-Posting-Date Sat, 3 Mar 2018 20:07:48 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="QP9Ek+qItqnsrddbfNu5KpjbG2S3NQswhzURcGEZpVzAqr8hTPkhq6Ptw6xV4Q78b997DVqNWha898csb1eEX9mnGwbSnpUy9KPowmbvmyPJD9gFYiJIEu/RcTguwaHn"; mail-complaints-to="abuse@albasani.net"
User-Agent Pan/0.144 (Time is the enemy; 28ab3ba git.gnome.org/pan2)
Cancel-Lock sha1:+SNPJsyTBTWTLjXtRBglVNj8eEQ=
Xref csiph.com comp.lang.java.programmer:38114

Show key headers only | View raw


On Fri, 02 Mar 2018 13:00:13 -0500, Arne Vajhøj wrote:

> Yes. But my argument is that:
> - the whole point of regex is that it is a compact and easy to read way
>    to do some advanced text stuff
> - if the regex is long and not easy to read then something else is
>    probably more easy to read
> - having to use tools to test if the regex does what one think it
>    does seems to be a good indication that it is not easy to read
>
Fair enough. I very rarely use regexes except as matchers and almost 
never for the sort of thing Eric is trying to do. In that case I'm far 
more likely to use one of the text parsing classes, though these often 
use regexes to decide what might be a keyword or separator.

> Splitting string without regex and then use simple regex on some of the
> parts or doing a high level split with simple regex and more detailed
> split using code are sometimes good choices.
>
+1

In practise I use regexes far more frequently in SpamAssassin (a Perl 
application) or in awk scripts than I do in Java or C programs, and if 
its a really complex task I'll use Coco/R to generate Java from a BNF 
definition.
  

-- 
Martin    | martin at
Gregorie  | gregorie dot org

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-01 06:19 -0800
  Re: regex replaceAll? Andreas Leitgeb <avl@logic.at> - 2018-03-01 19:03 +0000
    Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-01 12:15 -0800
      Re: regex replaceAll? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-03-01 21:51 +0100
        Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-01 13:36 -0800
          Re: regex replaceAll? Arne Vajhøj <arne@vajhoej.dk> - 2018-03-01 16:59 -0500
      Re: regex replaceAll? Andreas Leitgeb <avl@logic.at> - 2018-03-01 21:55 +0000
        Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-01 14:00 -0800
          Re: regex replaceAll? Andreas Leitgeb <avl@logic.at> - 2018-03-01 22:31 +0000
            Re: regex replaceAll? Arne Vajhøj <arne@vajhoej.dk> - 2018-03-01 17:52 -0500
              Re: regex replaceAll? Andreas Leitgeb <avl@logic.at> - 2018-03-02 00:14 +0000
            Re: regex replaceAll? Kiwi User <martin@mydomain.invalid> - 2018-03-02 00:43 +0000
              Re: regex replaceAll? Arne Vajhøj <arne@vajhoej.dk> - 2018-03-01 19:49 -0500
                Re: regex replaceAll? Kiwi User <martin@mydomain.invalid> - 2018-03-02 01:33 +0000
                Re: regex replaceAll? Arne Vajhøj <arne@vajhoej.dk> - 2018-03-02 13:00 -0500
                Re: regex replaceAll? Kiwi User <martin@mydomain.invalid> - 2018-03-03 20:07 +0000
            Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-02 05:40 -0800
              Re: regex replaceAll? Andreas Leitgeb <avl@logic.at> - 2018-03-02 17:46 +0000
                Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-02 10:38 -0800
                Re: regex replaceAll? Andreas Leitgeb <avl@logic.at> - 2018-03-02 20:15 +0000
                Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-02 12:43 -0800
                Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-02 12:58 -0800
                Re: regex replaceAll? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-03-03 00:06 +0100
  Re: regex replaceAll? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-03-01 20:29 +0100
    Re: regex replaceAll? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-03-01 20:30 +0100
    Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-01 12:28 -0800
      Re: regex replaceAll? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-03-01 21:40 +0100
    Re: regex replaceAll? Eric Douglas <e.d.programmer@gmail.com> - 2018-03-01 13:52 -0800
      Re: regex replaceAll? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-03-02 02:25 +0100

csiph-web