package re

  1. Overview
  2. Docs
RE is a regular expression library for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

1.13.2.tar.gz
md5=df37d9787450525a2182ce4364048d11
sha512=376b3ba1e351317a34b4c9a331fdc9ca5ae7c6a90eb2eb3393403a33b9f35ece63af7444a7c0c71ef29d512aa7fe56f7e485a118946e35d90039ddfd9127c020

doc/re.glob/Re_glob/index.html

Module Re_globSource

  • deprecated Use Re.Glob
include module type of struct include Re.Glob end
Sourceexception Parse_error
Sourceval glob : ?anchored:bool -> ?pathname:bool -> ?match_backslashes:bool -> ?period:bool -> ?expand_braces:bool -> ?double_asterisk:bool -> string -> (Re__.Ast.cset, [ `Cased | `Uncased ]) Re__.Ast.gen

Implements the semantics of shells patterns. The returned regular expression is unanchored by default.

Character '*' matches any sequence of characters and character '?' matches a single character. A sequence '...' matches any one of the enclosed characters. A sequence '^...' or '!...' matches any character *but* the enclosed characters. A backslash escapes the following character. The last character of the string cannot be a backslash.

anchored controls whether the regular expression will only match entire strings. Defaults to false.

pathname: If this flag is set, match a slash in string only with a slash in pattern and not by an asterisk ('*') or a question mark ('?') metacharacter, nor by a bracket expression ('') containing a slash. Defaults to true.

match_backslashes: If this flag is set, a forward slash will also match a backslash (useful when globbing Windows paths). Note that a backslash in the pattern will continue to escape the following character. Defaults to false.

period: If this flag is set, a leading period in string has to be matched exactly by a period in pattern. A period is considered to be leading if it is the first character in string, or if both pathname is set and the period immediately follows a slash. Defaults to true.

If expand_braces is true, braced sets will expand into multiple globs, e.g. a{x,y}b{1,2} matches axb1, axb2, ayb1, ayb2. As specified for bash, brace expansion is purely textual and can be nested. Defaults to false.

double_asterisk: If this flag is set, double asterisks ('**') will match slash characters, even if pathname is set. The period flag still applies. Default to true.

Sourceval glob' : ?anchored:bool -> bool -> string -> (Re__.Ast.cset, [ `Cased | `Uncased ]) Re__.Ast.gen

Same, but allows to choose whether dots at the beginning of a file name need to be explicitly matched (true) or not (false)

  • deprecated

    Use glob ~period.

Sourceval globx : ?anchored:bool -> string -> (Re__.Ast.cset, [ `Cased | `Uncased ]) Re__.Ast.gen

This version of glob also recognizes the pattern {..,..}

  • deprecated

    Prefer glob ~expand_braces:true.

Sourceval globx' : ?anchored:bool -> bool -> string -> (Re__.Ast.cset, [ `Cased | `Uncased ]) Re__.Ast.gen

This version of glob' also recognizes the pattern {..,..}

  • deprecated

    Prefer glob ~expand_braces:true ~period.

OCaml

Innovation. Community. Security.