Reverse Find URL
This crate provides a parser to search a string for URLs in reverse order.
All functionality is handled by the
Parser
struct which takes
chars
as input.
Examples
Text can be fed into the parser in reverse order:
use ;
let mut parser = new;
for c in "There_is_no_URL_here".chars.rev
The parser returns the length of the URL as soon as the last character of the URL is pushed into
it. Otherwise it will return
None
:
use ;
let mut parser = new;
// Parser guarantees there's currently no active URL
assert_eq!;
// URLs are only returned once they are complete
for c in "ttps://example.org".chars.rev
// Parser has detected a URL spanning the last 19 characters
assert_eq!;