=begin
Few Character Classes
/./ => Any character except a newline
/\w/ => A word character => [a-zA-Z0-9]
/\W/ => A non-word character => [^a-zA-Z0-9]
/\d/ - A digit character => [0-9]
/\D/ - A non-digit character => [^0-9]
/\h/ - A hexdigit character => [0-9a-fA-F]
/\H/ - A non-hexdigit character => [^0-9a-fA-F]
/\s/ - A whitespace character: => [ \t\r\n\f]
/\S/ - A non-whitespace character: => [^ \t\r\n\f]
=end
p /./ =~ "\nregex"
p /[\n]/ =~ "regex"
p /\w/ =~ "09777"
p /\W/ =~ "09777"
p /\d/ =~ "asfdsf"
p /\D/ =~ "fadfsdf"
p /\h/ =~ "kjdf"
p /\H/ =~ "kjdf"
p /\s/ =~ "\nhkjh"
p /\S/ =~ "\nhkjh"
=begin Few Character Classes /./ => Any character except a newline /\w/ => A word character => [a-zA-Z0-9] /\W/ => A non-word character => [^a-zA-Z0-9] /\d/ - A digit character => [0-9] /\D/ - A non-digit character => [^0-9] /\h/ - A hexdigit character => [0-9a-fA-F] /\H/ - A non-hexdigit character => [^0-9a-fA-F] /\s/ - A whitespace character: => [ \t\r\n\f] /\S/ - A non-whitespace character: => [^ \t\r\n\f]
=end
p /./ =~ "\nregex" p /[\n]/ =~ "regex" p /\w/ =~ "09777" p /\W/ =~ "09777" p /\d/ =~ "asfdsf" p /\D/ =~ "fadfsdf" p /\h/ =~ "kjdf" p /\H/ =~ "kjdf" p /\s/ =~ "\nhkjh" p /\S/ =~ "\nhkjh"