Function regex_automata::util::interpolate::find_cap_ref

source ·
fn find_cap_ref(replacement: &[u8]) -> Option<CaptureRef<'_>>
Expand description

Parses a possible reference to a capture group name in the given text, starting at the beginning of replacement.

If no such valid reference could be found, None is returned.

Note that this returns a “possible” reference because this routine doesn’t know whether the reference is to a valid group or not. If it winds up not being a valid reference, then it should be replaced with the empty string.