Regex Replace Online Tool

Regular Expression

Flags(Part 1)

Flags(Part 2)

Replace To

About Regex Replace Online Tool:

This online Regex Replace tool helps you to replace string using regular expression (Javascript RegExp).

cartoon text editor

Most Common Used Regular Expression:

Email Address: ^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$

Internet URL: [a-zA-z]+://[^\s]*

Chinese Character: [\u4e00-\u9fa5]

Password (starting with a letter, length between 6 and 18, can only contain letters, numbers and underscores): ^[a-zA-Z]\w{5,17}$

Does Regex Replace Online Tool log my data?

Absolutely NOT, this Regex Replacer doing all the formatting work on the client side, all logic are implemented by Javascript. There are 2 major advantages: 1.Your data never transmitted in the Open Internet, so you know it's secure; 2.It's much faster than doing all the work in the server side, because there is no Internet Delay.

More information:

Javascript RegExp CheatSheet:

Python re Library:

Wikipedia (Regular Expression):

Replace regular expression matches in a string using Javascript:

var regex_replacer = /test/gi;
var test_string = "This is a Test string.";
var replace_to_str = "Result";
var result = test_string.replace(regex_replacer,replace_to_str,test_string);

> "this is a Result string."

Replace regular expression matches in a string using Python:

import re

regex_replacer = re.compile("test", re.IGNORECASE)
test_string = "This is a Test string."
replace_to = "result"
result = regex_replacer.sub(replace_to, test_string)