summaryrefslogtreecommitdiff
path: root/lib/rexml/parsers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/parsers')
-rw-r--r--lib/rexml/parsers/baseparser.rb13
-rw-r--r--lib/rexml/parsers/xpathparser.rb2
2 files changed, 4 insertions, 11 deletions
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index 3c80231c35..09312abdde 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -25,15 +25,8 @@ module REXML
#
# Nat Price gave me some good ideas for the API.
class BaseParser
- if String.method_defined? :encode
- # Oniguruma / POSIX [understands unicode]
- LETTER = '[[:alpha:]]'
- DIGIT = '[[:digit:]]'
- else
- # Ruby < 1.9 [doesn't understand unicode]
- LETTER = 'a-zA-Z'
- DIGIT = '\d'
- end
+ LETTER = '[:alpha:]'
+ DIGIT = '[:digit:]'
COMBININGCHAR = '' # TODO
EXTENDER = '' # TODO
@@ -42,7 +35,7 @@ module REXML
NAME_STR= "(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})"
UNAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"
- NAMECHAR = '[\-\w\d\.:]'
+ NAMECHAR = '[\-\w:]'
NAME = "([\\w:]#{NAMECHAR}*)"
NMTOKEN = "(?:#{NAMECHAR})+"
NMTOKENS = "#{NMTOKEN}(\\s+#{NMTOKEN})*"
diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb
index aafa72ab9e..2db37a2578 100644
--- a/lib/rexml/parsers/xpathparser.rb
+++ b/lib/rexml/parsers/xpathparser.rb
@@ -551,7 +551,7 @@ module REXML
end
end
#puts "BEFORE WITH '#{rest}'"
- rest = LocationPath(rest, n) if rest =~ /\A[\/\.\@\[\w_*]/
+ rest = LocationPath(rest, n) if rest =~ /\A[\/\.\@\[\w*]/
parsed.concat(n)
return rest
end