1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253(* MParser, a simple monadic parser combinator library
-----------------------------------------------------------------------------
Copyright (C) 2008, Holger Arnold
2014-2020, Max Mouratov
License:
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2.1, as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Library General Public License version 2.1 for more details
(enclosed in the file LICENSE.txt).
*)moduleRegexp:MParser_Sig.Regexp=structtypet=Re.retypesubstrings=Re.Group.tletcompile_flags=[`Anchored]letmakepattern=Re.Perl.(compile(re~opts:compile_flagspattern))letget_substringsidx=trySome(Re.Group.getsidx)withNot_found->Noneletget_all_substringss=Re.Group.allsletexec~rex~posb=trySome(Re.exec~posrex(Bytes.unsafe_to_stringb))withNot_found->NoneendincludeMParser.MakeRegexp(Regexp)externalwrap:Re.re->Regexp.t="%identity"