pub enum Prim {
Show 13 variants
Boundary,
NonWordBoundary,
LineStart,
LineEnd,
Space,
None_,
AnyCharacter,
Word,
NotWord,
Alpha,
NotAlpha,
Digit,
NotDigit,
}Expand description
Zero-width and character-class primitives reachable from the ISC
grammar (zw_primitive rule) plus the Stdlib aliases they resolve
to. Values mirror Interscript::Stdlib::ALIASES.
Variants§
Boundary
\b — Unicode-aware word boundary (Ruby \b is Unicode; \w is not).
NonWordBoundary
\B
LineStart
^ — beginning of line.
LineEnd
$ — end of line.
Space
“ “ — a literal space (not re-only).
None_
“none” — empty string (not re-only).
AnyCharacter
any_character — Ruby regex dot: any char except newline.
Word
\w — ASCII-only [A-Za-z0-9_].
NotWord
\W
Alpha
[a-zA-Z]
NotAlpha
[^a-zA-Z]
Digit
\d — ASCII-only [0-9].
NotDigit
\D
Implementations§
Source§impl Prim
impl Prim
pub fn from_name(name: &str) -> Option<Prim>
pub fn name(&self) -> &'static str
Sourcepub fn re_only(&self) -> bool
pub fn re_only(&self) -> bool
Interscript::Stdlib.re_only_alias? — can the primitive appear
in a string / parallel (replacement) context? Only none/space.
Sourcepub fn matches_char(&self, ch: char) -> Option<bool>
pub fn matches_char(&self, ch: char) -> Option<bool>
Match as a character class at ch. None = zero-width (not a
char matcher) or not applicable.
Trait Implementations§
impl Copy for Prim
impl Eq for Prim
impl StructuralPartialEq for Prim
Auto Trait Implementations§
impl Forget for Prim
impl Freeze for Prim
impl RefUnwindSafe for Prim
impl Send for Prim
impl Sync for Prim
impl Unpin for Prim
impl UnsafeUnpin for Prim
impl UnwindSafe for Prim
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.