[][src]Function combine::parser::regex::match_

pub fn match_<R, Input>(regex: R) -> Match<R, Input> where
    R: Regex<Input::Range>,
    Input: RangeStream
This is supported on crate feature regex only.

Matches regex on the input returning the entire input if it matches. Never consumes any input.

extern crate regex;
extern crate combine;
use regex::Regex;
use combine::Parser;
use combine::parser::regex::match_;

fn main() {
    let regex = Regex::new("[:alpha:]+").unwrap();
    assert_eq!(
        match_(&regex).parse("abc123"),
        Ok(("abc123", "abc123"))
    );
}