Skip to main content

Regex

Struct Regex 

Source
pub struct Regex {
Show 15 fields prog: Vec<Inst>, pub ngroups: usize, pub ignorecase: bool, pub multiline: bool, pub dotall: bool, pub global: bool, pub sticky: bool, pub has_indices: bool, pub unicode: bool, pub unicode_sets: bool, nloops: usize, ncounters: usize, pub source: String, pub flags: String, pub group_names: Vec<(String, usize)>,
}

Fields§

§prog: Vec<Inst>§ngroups: usize§ignorecase: bool§multiline: bool§dotall: bool§global: bool§sticky: bool§has_indices: bool

d(hasIndices)フラグ。

§unicode: bool§unicode_sets: bool§nloops: usize§ncounters: usize§source: String§flags: String§group_names: Vec<(String, usize)>

Implementations§

Source§

impl Regex

Source

pub fn new(pattern: &str, flags: &str) -> Regex

パターンとフラグからコンパイル。失敗時はリテラル一致にフォールバック。

Source

pub fn find_at(&self, subject: &[char], start: usize) -> Option<Match>

start 以降で最初のマッチを探す。

Source

pub fn find_exact_at(&self, subject: &[char], start: usize) -> Option<Match>

y(sticky)フラグ用: start の位置でのみマッチを試みる(前方探索しない)。

Source

fn make_subject<'a>( &self, subject: &'a [char], ) -> (Subject<'a>, Option<Vec<usize>>)

Source

fn try_match_at_buf( &self, subject: &Subject<'_>, sp: usize, caps: &mut Vec<isize>, stash: &mut Vec<isize>, map: Option<&[usize]>, ) -> Option<Match>

Source

fn run( &self, pc: usize, s: &Subject<'_>, sp: usize, caps: &mut Vec<isize>, budget: &mut u32, stash: &mut Vec<isize>, ) -> bool

Auto Trait Implementations§

§

impl Freeze for Regex

§

impl RefUnwindSafe for Regex

§

impl Send for Regex

§

impl Sync for Regex

§

impl Unpin for Regex

§

impl UnsafeUnpin for Regex

§

impl UnwindSafe for Regex

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.