pub fn find_from_pos<'t>(&self, text: &'t str, pos: usize) -> Result<Option<Match<'t>>> {
        match &self.inner {
            RegexImpl::Wrap { inner, .. } => Ok(inner
                .find_at(text, pos)
                .map(|m| Match::new(text, m.start(), m.end()))),
            RegexImpl::Fancy { prog, options, .. } => {
                let result = vm::run(prog, text, pos, 0, options)?;
                Ok(result.map(|saves| Match::new(text, saves[0], saves[1])))
            }
        }
    }
/// Returns the first match in `text`, starting from the specified byte position `pos`.
///
/// # Examples
///
/// Finding match starting at a position:
///
/// ```
/// # use fancy_regex::Regex;
/// let re = Regex::new(r"(?m:^)(\d+)").unwrap();
/// let text = "1 test 123\n2 foo";
/// let mat = re.find_from_pos(text, 7).unwrap().unwrap();
///
/// assert_eq!(mat.start(), 11);
/// assert_eq!(mat.end(), 12);
/// ```
///
/// Note that in some cases this is not the same as using the `find`
/// method and passing a slice of the string, see [Regex::captures_from_pos()] for details.
Returns the first match in `text`, starting from the specified byte position `pos`.
Returns the first match in ` text ` starting from the specified byte position ` pos ` .
pub fn find_from_pos<'t>(&self, text: &'t str, pos: usize) -> Result<Option<Match<'t>>> {
        match &self.inner {
            RegexImpl::Wrap { inner, .. } => Ok(inner
                .find_at(text, pos)
                .map(|m| Match::new(text, m.start(), m.end()))),
            RegexImpl::Fancy { prog, options, .. } => {
                let result = vm::run(prog, text, pos, 0, options)?;
                Ok(result.map(|saves| Match::new(text, saves[0], saves[1])))
            }
        }
    }
pub fn find_from_pos < ' t > ( & self , text : & ' t str , pos : usize ) -> Result < Option < Match < ' t > > > { match & self . inner { RegexImpl :: Wrap { inner , .. } => Ok ( inner . find_at ( text , pos ) . map ( | m | Match :: new ( text , m . start ( ) , m . end ( ) ) ) ) , RegexImpl :: Fancy { prog , options , .. } => { let result = vm :: run ( prog , text , pos , 0 , options ) ? ; Ok ( result . map ( | saves | Match :: new ( text , saves [ 0 ] , saves [ 1 ] ) ) ) } } }
Returns the first match in `text`, starting from the specified byte position `pos`.
Returns the first match in ` text ` starting from the specified byte position ` pos ` .
&self
text
&'t str
pos
usize
&self
text
&'t str
pos
usize
examples
Finding match starting at a position.


Finding match starting at a position .
use fancy_regex::regex;




Note that in some cases this is not the same as using the `find`
method and passing a slice of the string, see [Regex::captures_from_pos()] for details.
Note that in some cases this is not the same as using the ` find ` method and passing a slice of the string see [ Regex :: captures_from_pos () ] for details .