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


Groups > linux.debian.user > #224886

Re: delimiters with more than one character?

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: delimiters with more than one character?
Date 2020-07-16 21:10 +0200
Message-ID <Athqx-2eq-7@gated-at.bofh.it> (permalink)
References <Athqx-2eq-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jul 16, 2020 at 11:42:10AM -0700, William Michels wrote:
> I've slowly been learning the Raku programming language (AKA Perl6), and
> while I'm far from being an expert, this is the first solution I came up
> with (raku one-or-two-liners, at the bash command prompt):
> 
> user@mbook:~$ raku -e ' my Str $s=" 34 + 45 \| abc \| 1 2 3 \| c\|123abc ";
> $s.put';
>  34 + 45 | abc | 1 2 3 | c|123abc

Already you have not produced the initial input correctly.  The \| is
supposed to be two characters within the actual input string.  The
task is to split the input string on this MULTIPLE-character delimiter
substring, and load the results into a bash array.

Anyone can split the string on a *single* delimiter character.  Even bash.

Back to linux.debian.user | Previous | Next | Find similar | Unroll thread


Thread

Re: delimiters with more than one character? Greg Wooledge <wooledg@eeg.ccf.org> - 2020-07-16 21:10 +0200

csiph-web