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.
frostcod Hello, any differences between Str and (Str)? 02:47
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
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
Thanks
scullucs m: put "qwe3 45 r 6.".comb(/\d+/).join 21:03
Raku eval 3456
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