Method: ArticleJSON::Import::GoogleDoc::HTML::EmbeddedSoundcloudParser.url_regexp

Defined in:
lib/article_json/import/google_doc/html/embedded_soundcloud_parser.rb

.url_regexpRegexp

Regular expression to check if a given string is a Soundcloud URL Also used to extract the ID from the URL.

Returns:

  • (Regexp)


16
17
18
19
20
21
22
# File 'lib/article_json/import/google_doc/html/embedded_soundcloud_parser.rb', line 16

def url_regexp
  %r{
    ^\S*                    # all protocols & sub domains
    soundcloud\.com/        # domain
    (?<id>[-/0-9a-z]+)      # the slug of the user / track
  }xi
end