Print all alphanumeric characters plus underscore

Ruby, 26 bytes

Characters can be printed in any order? Don't mind if I do!

Try it online!

$><<(?0..?z).grep(/\w/)*''

Perl, 20 bytes

Requires -E at no extra cost.

say+a.._,A.._,_..9,_

So, my original answer (below) was a bit too boring. The only thing I've managed to come up with is the above, that's exactly the same, but looks a bit more confusing... It's pretty much exactly equivalent to the below:

say a..z,A..Z,0..9,_

I like @msh210's suggestions in the comments, but they're just a bit too long!


Convex, 9 bytes

New method! Also, I realized that is it pretty much exactly the same as Luis' answer but in Convex, but I came up with this independently.

'{,®\W"Oò

Try it online!

Explanation:

'{,           Array of chars from NUL to 'z
   ®\W"       Regex to match non-word characters
       Oò     Replace all matches with emtpy string

Old solution, 10 bytes:

A,'[,_¬^'_

Try it online!

Explanation:

A,          0-9
'[,_¬^      A-Za-z
'_          _