Rust Regex Tester crates.io/crates/regex
Pattern: e.g. (?P<key>\w+)=(?P<value>\w+) , \d{1,3}(\.\d{1,3}){3} , (?imsU)^hello.*world$
Test Text:
Replace:

This tool is built on crates.io/crates/regex, the most widely used regular expression library in Rust. It features high performance, linear-time execution, full Unicode support, no backtracking, protection against catastrophic backtracking (ReDoS), a simple API, and thread safety.

The regular expressions entered in this page are actually compiled and executed using Rust’s regex engine, and you can observe the results of different methods (find, find_all, captures, split, test), which helps with development and debugging.

Install dependency (Cargo.toml):
[dependencies]
regex = "1"
Basic usage
use regex::Regex;

fn main() {
    let re = Regex::new(r"\d+").unwrap();

    if let Some(m) = re.find("abc123xyz") {

        println!("{}", m.as_str());

        println!("{}", m.start());

        println!("{}", m.end());
    }
}
Output:
123
3
6
FlagDescriptionExample
iCase-insensitive matching(?i)abc
mMultiline mode, ^ and $ match each line(?m)^abc$
sAllows . to match newline characters(?s)a.*b
xIgnore whitespace and allow comments(?x)a \s+ b
USwap greedy / non-greedy behavior(?U)a.*b
uEnable Unicode (enabled by default)(?u)\w+
ExpressionDescriptionExample
.Matches any character (default excludes newline)a.c
\dMatches digits\d+
\DMatches non-digits\D+
\wMatches word characters (Unicode)\w+
\WMatches non-word characters\W+
\sMatches whitespace characters\s+
\SMatches non-whitespace characters\S+
^Start of string^abc
$End of stringabc$
*0 or more repetitions of the previous expressiona*
+1 or more repetitions of the previous expressiona+
?0 or 1 repetition of the previous expressioncolou?r
{n}Exactly n repetitions\d{4}
{n,m}Between n and m repetitions\d{2,6}
[abc]Character set, matches any one character[abc]+
[^abc]Negated character set[^0-9]
(abc)Capturing group(\d+)
(?:abc)Non-capturing group(?:abc)+
(?P<name>abc)Named capturing group(?P<id>\d+)
a|bAlternation (OR)cat|dog
\bWord boundary\bword\b
\BNon-word boundary\Bing\B
\AStart of text\Aabc
\zEnd of textabc\z
\p{Han}Unicode character class\p{Han}+