summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-21 17:00:59 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-21 17:00:59 +0000
commitcdfb48ea7da4439d12b3a1936ad6d17b221e6740 (patch)
treee37ad8319ddec1a929b96a96cb0d354ea02a0062 /lib
parent58ef7c20880642c88d06b351f8bbaaa291898e58 (diff)
downloadruby-cdfb48ea7da4439d12b3a1936ad6d17b221e6740.tar.gz
* lib/date/format.rb, lib/uri/common.rb: `[', `]', `-' in chracter
class in regexp to avoid warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/date/format.rb2
-rw-r--r--lib/uri/common.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb
index 1b606cb043..2d5de09220 100644
--- a/lib/date/format.rb
+++ b/lib/date/format.rb
@@ -332,7 +332,7 @@ class Date
mday = $4.to_i
# vms
- elsif str.sub!(/(-?\d+)-(#{PARSE_MONTHPAT})[^-]*-(-?\d+)/ino, ' ')
+ elsif str.sub!(/(-?\d+)-(#{PARSE_MONTHPAT})[^\-]*-(-?\d+)/ino, ' ')
mday = $1.to_i
mon = ABBR_MONTHS[$2.downcase]
year = $3.to_i
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 5d6a3b5519..561b9ecb5b 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -49,9 +49,9 @@ module URI
FRAGMENT = "#{URIC}*"
# domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
- DOMLABEL = "(?:[#{ALNUM}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
+ DOMLABEL = "(?:[#{ALNUM}](?:[\\-#{ALNUM}]*[#{ALNUM}])?)"
# toplabel = alpha | alpha *( alphanum | "-" ) alphanum
- TOPLABEL = "(?:[#{ALPHA}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
+ TOPLABEL = "(?:[#{ALPHA}](?:[\\-#{ALNUM}]*[#{ALNUM}])?)"
# hostname = *( domainlabel "." ) toplabel [ "." ]
HOSTNAME = "(?:#{DOMLABEL}\\.)*#{TOPLABEL}\\.?"
@@ -119,7 +119,7 @@ module URI
REL_SEGMENT = "(?:[#{UNRESERVED};@&=+$,]|#{ESCAPED})+"
# scheme = alpha *( alpha | digit | "+" | "-" | "." )
- SCHEME = "[#{ALPHA}][-+.#{ALPHA}\\d]*"
+ SCHEME = "[#{ALPHA}][\\-+.#{ALPHA}\\d]*"
# abs_path = "/" path_segments
ABS_PATH = "/#{PATH_SEGMENTS}"