From 84f2f53c04c89e46e610d507099b62ed4880314e Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Tue, 25 Feb 2003 14:05:50 +0000 Subject: [PATCH] added is_blank_line facility to match line that should be ignored in indexes --- helm/http_getter/http_getter_common.ml | 5 +++++ helm/http_getter/http_getter_common.mli | 3 +++ 2 files changed, 8 insertions(+) diff --git a/helm/http_getter/http_getter_common.ml b/helm/http_getter/http_getter_common.ml index 40e5648ca..b6933218e 100644 --- a/helm/http_getter/http_getter_common.ml +++ b/helm/http_getter/http_getter_common.ml @@ -41,6 +41,11 @@ let is_nuprl_uri uri = Pcre.pmatch ~pat:"^nuprl:" uri let is_rdf_uri uri = Pcre.pmatch ~pat:"^helm:rdf(.*):(.*)//(.*)" uri let is_xsl_uri uri = Pcre.pmatch ~pat:"^\\w+\\.xsl" uri +let is_blank_line = + let blank_line_RE = Pcre.regexp "(^#)|(^\\s*$)" in + fun line -> + Pcre.pmatch ~rex:blank_line_RE line + let rec http_getter_uri_of_string = function | uri when is_rdf_uri uri -> (match Pcre.split ~pat:"//" uri with diff --git a/helm/http_getter/http_getter_common.mli b/helm/http_getter/http_getter_common.mli index 05f495f2f..711a5713d 100644 --- a/helm/http_getter/http_getter_common.mli +++ b/helm/http_getter/http_getter_common.mli @@ -36,6 +36,9 @@ val is_nuprl_uri: string -> bool val is_rdf_uri: string -> bool val is_xsl_uri: string -> bool + (** true on blanks-only and #-commented lines, false otherwise *) +val is_blank_line: string -> bool + val http_getter_uri_of_string: string -> http_getter_uri val patch_xml : string -> string -- 2.39.2