Sha256: 1c5adddead2b984899519495095e96e3b1ff6a126245b9b39307a6fd2108247f

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

# frozen-string-literal: true

module SearchLingo
  ##
  # Pattern for matching modifiers within a token.
  MODIFIER = /[[:alnum:]]+/.freeze

  ##
  # Pattern for matching a simple token.
  SIMPLE_TOKEN = /"[^"]+"|[[:graph:]]+/.freeze

  ##
  # Pattern for matching a simple or compound token.
  SIMPLE_OR_COMPOUND_TOKEN = /(?:#{MODIFIER}:[[:space:]]*)?#{SIMPLE_TOKEN}/.freeze

  ##
  # Pattern for matching a simple or compound token, with regex grouping to aid
  # in decomposing the token into its modifier and term components.
  SIMPLE_OR_COMPOUND_TOKEN_WITH_GROUPING = /\A(?:(#{MODIFIER}):[[:space:]]*)?(#{SIMPLE_TOKEN})\z/.freeze

  ##
  # Pattern for matching the delimiter between tokens.
  DELIMITER = /[[:space:]]*/.freeze
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
search_lingo-3.0.0.pre1 lib/search_lingo/constants.rb