Module: ThemeCheck::RegexHelpers

Instance Method Summary collapse

Instance Method Details

#matches(s, re) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/theme_check/regex_helpers.rb', line 5

def matches(s, re)
  start_at = 0
  matches = []
  while (m = s.match(re, start_at))
    matches.push(m)
    start_at = m.end(0)
  end
  matches
end