pub enum TypeTrue {
Regex,
}
Expand description
This is the regex replacement type. You can use this to replace a word or phrase that matches a pattern. Usage: - Replace all numbers with "some number": { type: ‘regex’, regex: ‘\\d+’, value: ‘some number’ } - Replace email addresses with "[EMAIL]": { type: ‘regex’, regex: ‘\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b’, value: ‘[EMAIL]’ } - Replace phone numbers with a formatted version: { type: ‘regex’, regex: ‘(\\d{3})(\\d{3})(\\d{4})’, value: ‘($1) $2-$3’ } - Replace all instances of "color" or "colour" with "hue": { type: ‘regex’, regex: ‘colou?r’, value: ‘hue’ } - Capitalize the first letter of every sentence: { type: ‘regex’, regex: ‘(?<=\\. |^)[a-z]’, value: (match) => match.toUpperCase() }
Variants§
Regex
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeTrue
impl<'de> Deserialize<'de> for TypeTrue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for TypeTrue
impl Ord for TypeTrue
Source§impl PartialOrd for TypeTrue
impl PartialOrd for TypeTrue
impl Copy for TypeTrue
impl Eq for TypeTrue
impl StructuralPartialEq for TypeTrue
Auto Trait Implementations§
impl Freeze for TypeTrue
impl RefUnwindSafe for TypeTrue
impl Send for TypeTrue
impl Sync for TypeTrue
impl Unpin for TypeTrue
impl UnwindSafe for TypeTrue
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