Sha256: aef91a7483fede9cbf69fccc977709927460e38aa9bf61562f2956f66b622fa3

Contents?: true

Size: 570 Bytes

Versions: 13

Compression:

Stored size: 570 Bytes

Contents

# frozen_string_literal: true

module ThemeCheck
  module RegexHelpers
    LIQUID_TAG = /#{Liquid::TagStart}.*?#{Liquid::TagEnd}/om
    LIQUID_VARIABLE = /#{Liquid::VariableStart}.*?#{Liquid::VariableEnd}/om
    LIQUID_TAG_OR_VARIABLE = /#{LIQUID_TAG}|#{LIQUID_VARIABLE}/om
    HTML_LIQUID_PLACEHOLDER = /≬[0-9a-z\n]+[#\n]*≬/m
    START_OR_END_QUOTE = /(^['"])|(['"]$)/

    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
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
theme-check-1.15.0 lib/theme_check/regex_helpers.rb
theme-check-1.14.0 lib/theme_check/regex_helpers.rb
theme-check-1.13.0 lib/theme_check/regex_helpers.rb
theme-check-1.12.1 lib/theme_check/regex_helpers.rb
theme-check-1.12.0 lib/theme_check/regex_helpers.rb
theme-check-1.11.0 lib/theme_check/regex_helpers.rb
theme-check-1.10.3 lib/theme_check/regex_helpers.rb
theme-check-1.10.2 lib/theme_check/regex_helpers.rb
theme-check-1.10.1 lib/theme_check/regex_helpers.rb
theme-check-1.10.0 lib/theme_check/regex_helpers.rb
theme-check-1.9.2 lib/theme_check/regex_helpers.rb
theme-check-1.9.1 lib/theme_check/regex_helpers.rb
theme-check-1.9.0 lib/theme_check/regex_helpers.rb