fix `regexp-match-exact?' to work on paths, drop ports from docs

Closes PR 11213
This commit is contained in:
Matthew Flatt 2011-01-08 08:21:52 -07:00
parent f624ebdf20
commit 9e9a3ef814
2 changed files with 9 additions and 3 deletions

View File

@ -451,7 +451,13 @@
(and m (zero? (caar m))
(= (cdar m)
(cond [(bytes? s) (bytes-length s)]
[(or (byte-regexp? p) (bytes? p)) (string-utf-8-length s)]
[else (string-length s)])))))
[(or (byte-regexp? p) (bytes? p))
(if (path? s)
(bytes-length (path->bytes s))
(string-utf-8-length s))]
[else
(if (path? s)
(string-length (path->string s))
(string-length s))])))))
)

View File

@ -457,7 +457,7 @@ match succeeds, @racket[#f] otherwise.
@defproc[(regexp-match-exact? [pattern (or/c string? bytes? regexp? byte-regexp?)]
[input (or/c string? bytes? path? input-port?)])
[input (or/c string? bytes? path?)])
boolean?]{
Like @racket[regexp-match?], but @racket[#t] is only returned when the