This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0
Glob/Fn-match style string matching
version 1.0.1
license BSD-3-Clause
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.1
Committed At 2018-04-06 13:05:20 UTC
elm-tools/parser 2.0.1 <= v < 3.0.0 2.0.1
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1

Modules

README

Elm Glob

A module for glob/fn-match based string matching. Patterns are parsed and converted to regexes and matched using the core Regex library.

Features

Syntax

  • * - matches everything
  • ? - matches any single character
  • [set] - matches any character in the set
  • [!set] - matches any character not in the set

The set syntax also supports ranges. eg. a-z, 0-6, etc. Only ASCII letters & numbers as I'm unclear on how to properly support other locales.

Options

Available with the defaultOptions record which has the Options type.

  • enableAsterisk (default: True) Can be used to disable the handling of '*'

  • enableQuestionMark (default: True) Can be used to disable the handling of '?'

  • enableBrackets (default: True) Can be used to disable the handling of characters sets that use '[]'

Available as an independent function:

  • Glob.caseInsenstive Sets 'caseInsenstive' on the underlying Regex.

Contribute

Run:

  • yarn or npm install to set up
  • yarn test to run the tests

Please add tests to help cover any changes you are making.

The name & API are subject to change. I would welcome any help & advice on making them better.