5 added 51 characters in body
source | link

Ruby, 137 87 82 76 6767 55 bytes

Ungolfed, but you can see the pattern.

gets$><<gets.chars{|c|$><<gsub(c=~/\w[a-z0-9]/?((c<?A??0:c>?Z??a:?Ai){[*" 0Aa"[$&.ord/32].c).inject(:+):c)$&]*""}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

Edit 3: Thanks to manatwork for golfing 12 bytes!

Ruby, 137 87 82 76 67 bytes

Ungolfed, but you can see the pattern.

gets.chars{|c|$><<(c=~/\w/?((c<?A??0:c>?Z??a:?A)..c).inject(:+):c)}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

Ruby, 137 87 82 76 67 55 bytes

Ungolfed, but you can see the pattern.

$><<gets.gsub(/[a-z0-9]/i){[*" 0Aa"[$&.ord/32]..$&]*""}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

Edit 3: Thanks to manatwork for golfing 12 bytes!

4 added 1 character in body
source | link

Ruby, 137 87 82 7676 67 bytes

Ungolfed, but you can see the pattern.

gets.chars{|c|$><<(c=~/[A-Za-z0-9]\w/?((c<?A??0:c>?Z??a:?A)..c).inject(:+):c)}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

Ruby, 137 87 82 76 bytes

Ungolfed, but you can see the pattern.

gets.chars{|c|$><<(c=~/[A-Za-z0-9]/?((c<?A??0:c>?Z??a:?A)..c).inject(:+):c)}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

Ruby, 137 87 82 76 67 bytes

Ungolfed, but you can see the pattern.

gets.chars{|c|$><<(c=~/\w/?((c<?A??0:c>?Z??a:?A)..c).inject(:+):c)}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

3 added 42 characters in body
source | link

Ruby, 137 87 8282 76 bytes

Ungolfed, but you can see the pattern.

gets.chars{|c|$><<(c=~/[A-Za-z0-9]/ ? ((c<?A ? ?0:c>?Z ? ?a:?A)..c).inject(:+):c)}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

Ruby, 137 87 82 bytes

Ungolfed, but you can see the pattern.

gets.chars{|c|$><<(c=~/[A-Za-z0-9]/ ? ((c<?A ? ?0:c>?Z ? ?a:?A)..c).inject(:+):c)}

Edit: golfed down to only one regex.

Ruby, 137 87 82 76 bytes

Ungolfed, but you can see the pattern.

gets.chars{|c|$><<(c=~/[A-Za-z0-9]/?((c<?A??0:c>?Z??a:?A)..c).inject(:+):c)}

Edit: golfed down to only one regex.

Edit 2: had a lot of extra spaces.

2 added 5 characters in body
source | link
1
source | link