We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7506695 commit 500d5d9Copy full SHA for 500d5d9
1 file changed
lib/rdf/model/literal.rb
@@ -360,7 +360,7 @@ def has_datatype?
360
# @return [Boolean] `true` or `false`
361
# @since 0.2.1
362
def valid?
363
- return false if language? && language.to_s !~ /^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/
+ return false if language? && language.to_s !~ /^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/
364
return false if datatype? && datatype.invalid?
365
grammar = self.class.const_get(:GRAMMAR) rescue nil
366
grammar.nil? || value.match?(grammar)
0 commit comments