This channel is intended for people just starting with the Raku Programming Language ( Logs are available at
Set by lizmat on 8 June 2022.
00:43 guifa_ joined, poohman joined 00:45 guifa left 01:12 razetime joined 01:50 MasterDuke left
frostcod Hello, any differences between Str and (Str)? 02:47
04:09 razetime left 04:50 razetime joined 05:42 siavash joined 06:03 kjp left 06:06 kjp joined 06:14 tea3po left 06:15 teatime joined 07:02 camelia left, KOTP left 07:16 KOTP joined 07:19 Kubic joined 07:20 Kubic left 07:36 camelia joined
lizmat Str is the name of the type object for strings, (Str) is a .gist representation of that type object that you e.g. get with "say": say Str # (Str) 07:49
08:13 dakkar joined, teatwo joined 08:14 teatwo left, teatwo joined 08:16 teatime left 08:20 razetime left 08:31 razetime joined 10:34 siavash left 11:13 teatwo left 11:14 teatwo joined 12:25 A26F64 joined 12:37 razetime left 13:05 poohman left 13:59 razetime joined 14:00 A26F64 left 14:11 ab5tract joined 15:26 jgaz_ left, jgaz joined 16:31 dakkar left 17:42 razetime left 17:53 ab5tract left 18:39 ab5tract joined 18:49 teatwo left 18:50 teatwo joined 19:38 habere-et-disper joined 19:52 habere-et-disper left
jgaz possibly dumb question: if I want to extract a digit from a string I used m/\d/. If I want to extract a digit, until I hit a non-digit, I use m/\d+/ but how do I extract all digits ignoring all non-digit characters? 20:01
nemokosch in your place, I would replace non-digit characters to the empty string 20:02
the :global adverb can also help, it makes the match return all non-overlapping matches as a List 20:03
jgaz Let me try that
yeah m:g is close to what I want. I think I can work with it. 20:05
20:13 tea3po joined 20:14 tea3po left, tea3po joined 20:16 teatwo left
scullucs m: put "qwe3 45 r 6.".comb(/\d+/).join 21:03
Raku eval 3456
21:50 tea3po left 21:51 tea3po joined 22:13 ab5tract left 23:05 ab5tract joined
guifa_ yeah, comb is basically m:g//. Also comb with no args is equivalent to comb(/./) so handy way to grab a list of characters 23:23
nemokosch comb produces just the string as opposed to match objects iirc 23:25
guifa_ ah yes that too
so really, (m:g/…/)».Str 23:26