class Playwright::JavaScript::Regex

def flag_for(regexp)

def flag_for(regexp)
= []
<< 'ms' if (regexp.options & Regexp::MULTILINE) != 0
<< 'i' if (regexp.options & Regexp::IGNORECASE) != 0
join('')

def initialize(regexp)

def initialize(regexp)
  unless regexp.is_a?(Regexp)
    raise ArgumentError("Argument must be a Regexp: #{regexp} (#{regexp.class})")
  end
  @source = regexp.source
  @flag = flag_for(regexp)
end