Regex Tester Online Tool
About Regex Tester Online Tool:
This online Regex Tester tool helps you to test if your regular expression is working correctly. It support Matching h2-highlight and 6 different Flags, powered by Javascript RegExp.
| Flags Type | Description |
|---|---|
| g | (global match), find all matches |
| i | ignore case |
| m | multiline; treat beginning and end characters (^ and $) as working over multiple lines |
| s | allows . to match newlines |
| u | Unicode; treat pattern as a sequence of Unicode |
| y | sticky; matches only from the index indicated by the lastIndex |
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 Tester Online Tool log my data?
Absolutely NOT, this Regex Tester 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: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
Python re Library: https://docs.python.org/3/library/re.html
Wikipedia (Regular Expression): https://en.wikipedia.org/wiki/Regular_expression
Test if string matches a regular expression using Javascript:
var regex_tester = /([A-Z])\w+/g; var test_string = "This is a Test string." console.log(regex_tester.test(test_string)) ------------------- > true
Test if string matches a regular expression using Python:
import re
regex_tester = re.compile("([A-Z])\w+", re.I | re.DOTALL)
test_string = "This is a Test string."
if regex_tester.match(test_string):
print("True")
else:
print("False")