Function
matches
(
ftx: &FunctionContext,
This(this): This<Arc<String>>,
regex: Arc<String>,
)
Source from the content-addressed store, hash-verified
| 276 | /// ``` |
| 277 | #[cfg(feature = "regex")] |
| 278 | pub fn matches( |
| 279 | ftx: &FunctionContext, |
| 280 | This(this): This<Arc<String>>, |
| 281 | regex: Arc<String>, |
| 282 | ) -> Result<bool> { |
| 283 | match regex::Regex::new(®ex) { |
| 284 | Ok(re) => Ok(re.is_match(&this)), |
| 285 | Err(err) => Err(ftx.error(format!("'{regex}' not a valid regex:\n{err}"))), |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | use crate::common::value::Val; |
| 290 | #[cfg(feature = "chrono")] |
Callers
nothing calls this directly
Tested by
no test coverage detected