2
* ExtStr - Additional functions for regular expressions manipulation
3
* Copyright (C) 2008 David Teller, LIFO, Universite d'Orleans
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version,
9
* with the special exception on linking described in file LICENSE.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
TYPE_CONV_PATH "" (*For Sexplib, Bin-prot...*)
29
let search ?(offset=0) ?(backwards=false) r s =
30
let next = if backwards then search_backward
34
try let offset' = next r s offset in
35
Some ((match_beginning (), match_end (), matched_string s), offset')
36
with Not_found -> None
37
in Enum.unfold offset aux