Skip to content

Commit

Permalink
* lib/date/format.rb, lib/uri/common.rb: [', ]', `-' in chracter
Browse files Browse the repository at this point in the history
  class in regexp to avoid warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Mar 21, 2003
1 parent 58ef7c2 commit cdfb48e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Sat Mar 22 01:59:04 2003 Tanaka Akira <[email protected]>

* lib/date/format.rb, lib/uri/common.rb: `[', `]', `-' in chracter
class in regexp to avoid warning.

Fri Mar 21 23:40:41 2003 Tanaka Akira <[email protected]>

* regex.c (re_compile_pattern): fix previous change.
Expand Down
2 changes: 1 addition & 1 deletion lib/date/format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def self._parse(str, comp=false)
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
Expand Down
6 changes: 3 additions & 3 deletions lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ module PATTERN
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}\\.?"

Expand Down Expand Up @@ -119,7 +119,7 @@ module PATTERN
REL_SEGMENT = "(?:[#{UNRESERVED};@&=+$,]|#{ESCAPED})+"

# scheme = alpha *( alpha | digit | "+" | "-" | "." )
SCHEME = "[#{ALPHA}][-+.#{ALPHA}\\d]*"
SCHEME = "[#{ALPHA}][\\-+.#{ALPHA}\\d]*"

# abs_path = "/" path_segments
ABS_PATH = "/#{PATH_SEGMENTS}"
Expand Down

0 comments on commit cdfb48e

Please sign in to comment.