Skip to content

Instantly share code, notes, and snippets.

@ileitch
Created December 7, 2012 21:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ileitch/4236706 to your computer and use it in GitHub Desktop.
Save ileitch/4236706 to your computer and use it in GitHub Desktop.
MRI 1.8.7-p371
>> $KCODE
=> "NONE"
>> "s.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/i
=> 0
>> $KCODE = 'UTF8'
=> "UTF8"
>> "s.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/i
=> 0
MRI 1.9.3-p327, Rubinius f76d3f67, JRuby 1.7.1 (1.9.3)
>> "s.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/i
=> nil
>> "t.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/i
=> 0
>> "s.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/
=> 0
Rubinius f76d3f67, JRuby 1.7.1 (1.8.7)
>> $KCODE
=> "NONE"
>> "s.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/i
=> 0
>> $KCODE = 'UTF8'
=> "UTF8"
>> "s.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/i
=> nil
>> "t.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/i
=> 0
>> "s.net" =~ /\A[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.?\Z/
=> 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment