From a321c85a298aab0c40746ca11214f02bed68b092 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Wed, 10 Feb 2016 13:13:12 -0500 Subject: [PATCH] update string->url doc with better regexp to sync with https://github.com/racket/racket/commit/e6a0caa1471820ae1f8a76985858b197a35763a3 --- net-doc/net/scribblings/url.scrbl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/net-doc/net/scribblings/url.scrbl b/net-doc/net/scribblings/url.scrbl index 792ba25991..89463ffda5 100644 --- a/net-doc/net/scribblings/url.scrbl +++ b/net-doc/net/scribblings/url.scrbl @@ -99,9 +99,13 @@ A pair that joins a path segment with its params in a URL.} paths to from URL structure types and back again are provided by the @racketmodname[net/url-string] library, and re-exported by @racketmodname[net/url].} -@defproc[(string->url [str (or/c (not/c #rx"^([^:/?#]*):") - #rx"^[a-zA-Z][a-zA-Z0-9+.-]*:")]) - url?]{ +@defthing[url-regexp regexp?]{ +A @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{regexp value} +that can be useful for matching url strings. Mostly follows +RFC 3986 @cite["RFC3986"], Appendix B, except for using @tt{*} instead of +@tt{+} for the scheme part (see @racket[url]).} + +@defproc[(string->url [str url-regexp]) url?]{ Parses the URL specified by @racket[str] into a @racket[url] struct. The @racket[string->url] procedure uses @@ -138,7 +142,9 @@ the path. @history[#:changed "6.3.0.1" @elem{Changed handling of @litchar{file:} URLs when the value of @racket[file-url-path-convention-type] - is @racket['windows].}]} + is @racket['windows].}] +@history[#:changed "6.4.0.7" @elem{Use more specific regexp for + input contract.}]} @defproc[(combine-url/relative [base url?] [relative string?]) url?]{