This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
Tirifto I wonder: is there some way I can match several strings/elements at most once in whatever order in a regular expression? 00:45
Basically something like this: /«[ a || ab || ac || abc || acb || b || ba || bc || bac || bca || c || ca || cb || cab || cba ]»/, but written more like this: /«[ a || b || c ]¤»/, where ¤ means ‘match this once or more, but without any of the alterations repeating’. 00:51
alternations* I guess I could insert pieces of code to keep track of this, but this feels like something a more elegant solution might exist for. `o` 00:52
(I also suppose I could just generate combinations for <a b c> in this example, but I’m more generally curious if regexes have any combination-like manipulations or the like.) 01:02
wambash m: my %strings := bag <a b c>; say "cabacbca".match: / .+ <?{ $/.comb ⊆ %strings}> /,:ex 04:28
Raku eval (「cab」 「ca」 「c」 「ab」 「a」 「bac」 「ba」 「b」 「acb」 「ac」 「a」 「cb」 「c」 「bca」 「bc」 「b」 「ca」 「c」 「a」)
deoac How would I create a regex which is an alteration of the elements of a list?  E.g. create `/'foo'|'bar'|'baz'/` from `<foo bar baz>` 21:23
librasteve m: my @l = <foo bar baz>; my $r = /<@l>/; say 'foo' ~~ $r; 22:11
Raku eval 「foo」
deoac Thanks, I clearly was overthinking it. 23:06