[][src]Crate hashtag

The goal of this crate is to match Instagram's parsing of hashtags. So if you find strings that aren't parsed correctly please open an issue 😃

Sample usage

let tags: Vec<Hashtag> = Hashtag::parse("#rust is #awesome");

assert_eq!(
    tags,
    [
        Hashtag {
            text: "rust".to_string(),
            start: 0,
            end: 4,
        },
        Hashtag {
            text: "awesome".to_string(),
            start: 9,
            end: 16,
        },
    ]
);

See tests for specifics about what is considered a hashtag and what is not.

Structs

Hashtag

A hashtag found in some text. See documentation of top level module for more info.