Methods to validate strings with character classes
Method to check if the string may be parsed to an integer or float
Return the indices of all ocurrences of a string
Provides methods to match words with differnt word boundary and case-semsitivity rules
Set of methods to capture groups or match objects derived from Regex::captures.
This library provides a set of traits and extension methods for &str and/or String
to facilitate common string manipulations routines that may require multiple steps
with the Rust standard library + Regex.
Once installed you need not explicitly add regex::* to your project and
string types will have many new match, replace, split and extract methods.
Most methods imvoling regular expressions have variants ending in result returning the reuslt
type with an error from the Regex crate and without, that return false and skips replacements
if the regular is invalid. Use the main methods if you have tested your regular expression.
There are also variants with a case_insensitive flag and without (_ci and _cs).
When used on arrays or vectors of strings each regular expression will only be compiled and checked once, when you need
to search within a large set of text records.
Complex regular expressions, e.g. with look behind (?<=foo) or look ahead, work best after isolating a sample text snippet via simpler text-matching methods.
Always consider the simplest strategy for extracting text, e.g. via to_head_tail(), to_segments(), before resorting to the regex-enabled pattern-prefixed methods.
Core regular expression match methods
Provides methods to match with multiple patterns
expressed as arrays of tuples or simple strs (for pattern_match_many_ci and pattern_match_many_cs)
Pattern methods for arrays or vectors only, return vectors of booleans matching each input string
Core regular expression replacement methods
Provides methods to replace with multiple patterns
expressed as arrays of tuples
Provides methods to split a &str/string on a regular expression
Methods for whole or partial word replacements
Regex-free matcher methods for common use cases
Set of methods to strip unwanted characters by type or extract vectors of numeric strings, integers or floats
Methods to split a longer strong on a separator and return a vector of strings,
a tuple of two strings or single optional string segment
Note some methods may return empty segments in the case of leading, trailing or repeated separators
See notes below
Converts arrays or vectors of strs to a vector of owned strings