End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
URI.extract
extract(str, schemes = nil, &block)
lib/uri/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/uri/common.rb, line 235
def self.extract(str, schemes = nil, &block)
warn "URI.extract is obsolete", uplevel: 1 if $VERBOSE
DEFAULT_PARSER.extract(str, schemes, &block)
end
Synopsis
URI::extract(str[, schemes][,&blk])
Args
Description
Extracts URIs from a string. If block given, iterates through all matched URIs. Returns nil if block given or array with matches.
Usage
Example
require "uri" URI.extract("text here http://foo.example.org/bla and here mailto:[email protected] and here also.") # => ["http://foo.example.com/bla", "mailto:[email protected]"]