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


Groups > linux.debian.user > #224890

Re: delimiters with more than one character?

From William Michels <wjm1@caa.columbia.edu>
Newsgroups linux.debian.user
Subject Re: delimiters with more than one character?
Date 2020-07-17 04:10 +0200
Message-ID <AtnYZ-6Zc-1@gated-at.bofh.it> (permalink)
References <Athqx-2eq-9@gated-at.bofh.it> <Athqy-2eq-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Jul 16, 2020 at 12:03 PM Nicolas George wrote:
>
> Observe your output carefully. You'll notice that the string you defined
> does not actually contain any backslash.
>
> Regards,
>
>   Nicolas George

Thank you, Nicholas!

Looks like the trick for Raku one-liners on the bash command line is to use
single quotes on the outside, and one of Raku's quoting-language constructs
(Q[ ... ], known as the Raku 'literal string' construct) on the inside.
Note splitting on the two-character "\|" delimiter in the second (final)
statement:

user@mbook:~$ raku -e 'my Str $s= Q[ 34 + 45 \| abc \| 1 2 3 \| c\|123abc
]; .raku.put for $s.split( Q[\|] );'
" 34 + 45 "
" abc "
" 1 2 3 "
" c"
"123abc "
user@mbook:~$

Reference: "The Q Lang"
https://docs.raku.org/language/quoting

HTH, Bill.

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


Thread

Re: delimiters with more than one character? William Michels <wjm1@caa.columbia.edu> - 2020-07-16 21:10 +0200
  Re: delimiters with more than one character? Nicolas George <george@nsup.org> - 2020-07-16 21:10 +0200
    Re: delimiters with more than one character? William Michels <wjm1@caa.columbia.edu> - 2020-07-17 04:10 +0200
  Re: delimiters with more than one character? Dan Ritter <dsr@randomstring.org> - 2020-07-16 21:30 +0200
    Re: delimiters with more than one character? David Wright <deblis@lionunicorn.co.uk> - 2020-07-17 05:00 +0200
      Re: delimiters with more than one character? Dan Ritter <dsr@randomstring.org> - 2020-07-17 14:40 +0200

csiph-web