package mparser

  1. Overview
  2. Docs

Module MParser.MakeRegexpSource

Parameters

Signature

Sourceval match_regexp : 's state -> Regexp.t -> Regexp.substrings option

match_regexp s rex matches the regular expression rex against the input. It returns Some substrings if the match succeeds, where substrings contains the matched substrings. If the match fails or if the current position is already behind the last position of the input, it returns None.

If the input is read from a (large) file, rex is not necessarily matched against the complete remaining substring. The minimum number of characters that are guaranteed to be used for matching is specified when creating the input character stream. See the documentation of the MParser_Char_Stream module for more information.

Sourceval make_regexp : string -> Regexp.t

Creates a regular expression from a string.

Sourceval regexp : Regexp.t -> (string, 's) t

regexp rex parses any string matching the regular expression rex and returns it.

If the input is read from a (large) file, rex is not necessarily matched against the complete remaining substring. The minimum number of characters that are guaranteed to be used for matching is specified when creating the input character stream. See the documentation of the MParser_Char_Stream module for more information.

Sourceval regexp_substrings : Regexp.t -> (string array, 's) t

regexp_substrings rex parses any string matching the regular expression rex and returns an array containing all matched substrings.

If the input is read from a (large) file, rex is not necessarily matched against the complete remaining substring. The minimum number of characters that are guaranteed to be used for matching is specified when creating the input character stream. See the documentation of the MParser_Char_Stream module for more information.

Sourcemodule Tokens : sig ... end

Predefined token parsers.