This file is indexed.

/usr/lib/ocaml/re/re_posix.mli is in libre-ocaml-dev 1.2.1-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
(*
   RE - A regular expression library

   Copyright (C) 2001 Jerome Vouillon
   email: Jerome.Vouillon@pps.jussieu.fr

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   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
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*)

(*
   References:
     http://www.opengroup.org/onlinepubs/007908799/xbd/re.html
     http://www.opengroup.org/onlinepubs/007908799/xsh/regcomp.html
*)

(* XXX Character classes *)

(* Errors that can be raised during the parsing of the regular expression *)
exception Parse_error
exception Not_supported

type opt = [`ICase | `NoSub | `Newline]

(* Parsing of a Posix extended regular expression *)
val re : ?opts:(opt list) -> string -> Re.t

(* Regular expression compilation *)
val compile : Re.t -> Re.re
   (* [compile r] is defined as [Re.compile (Re.longest r)] *)
val compile_pat : ?opts:(opt list) -> string -> Re.re

(*
Deviation from the standard / ambiguities in the standard
---------------------------------------------------------
We tested the behavior of the Linux library (glibc) and the Solaris
library.

(1) An expression [efg] should be parsed as [(ef)g].
    All implementations parse it as [e(fg)].
(2) When matching the pattern "((a)|b)*" against the string "ab",
    the sub-expression "((a)|b)" should match "b", and the
    sub-expression "(a)" should not match anything.
    In both implementation, the sub-expression "(a)" matches "a".
(3) When matching the pattern "(aa?)*" against the string "aaa", it is
    not clear whether the final match of the sub-expression "(aa?)"  is
    the last "a" (all matches of the sub-expression are successively
    maximized), or "aa" (the final match is maximized).
    Both implementations implements the first case.
(4) When matching the pattern "((a?)|b)*" against the string "ab",
    the sub-expression "((a?)|b)" should match the empty string at the
    end of the string (it is better to match the empty string than to
    match nothing).
    In both implementations, this sub-expression matches "b".
    (Strangely, in the Linux implementation, the sub-expression "(a?)"
     correctly matches the empty string at the end of the string)

This library behaves the same way as the other libraries for all
points, except for (2) and (4) where it follows the standard.

The behavior of this library in theses four cases may change in future
releases.
*)