# frozen_string_literal: true # Detect links matching the following formats: # Zoom Start links: https://zoom.us/s/ # Zoom Join links: https://zoom.us/j/ # Personal Zoom links: https://zoom.us/my/ # Vanity Zoom links: https://gitlab.zoom.us/j/ (also /s and /my) module Gitlab class ZoomLinkExtractor ZOOM_REGEXP = %r{https://(?:[\w-]+\.)?zoom\.us/(?:s|j|my)/\S+}.freeze def initialize(text) @text = text.to_s end def links @text.scan(ZOOM_REGEXP) end def match? ZOOM_REGEXP.match?(@text) end end end