Regex Explorer

regexmatch.dev is the largest regular expression database for regex pattern and matches containing searchable and filterable records for many different languages

Markdown table Python regex

works with tables embedded in paragraphs

Telephone Number for Colombia

Permite validar un número celular en colombia

Match all numbers

Match all numbers from a string.

xxx-xxx-xxxx

☎️

Sınıfları Tek Tek seçme

za

Capturing between phrases across multiple lines

Discussion https://www.reddit.com/r/regex/comments/kxtyl6/capturing_between_phrases_across_multiple_lines/ https://www.reddit.com/user/Pauley0/

zpool status

Matches the output of zpool status -v. Use preg_match_all with PREG_SET_ORDER to match multiple pools

Nitroflare ID

https://nitroflare.com/view/845F2436715ASF5/XUYZ.zip

value-attached text

value-attached text

Python-Dunder-Underscore

# Python Dunder Underscore Regular Expression # ## Match ## ```python # coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r'^(__version__)(\s?=\s?)+("(.*)")' test_str = "__version__ = \"0.1.1.1\"" matches = re.search(regex, test_str) if matches: print ("Match was found at {start}-{end}: {match}".format(start = matches.start(), end = matches.end(), match = matches.group())) for groupNum in range(0, len(matches.groups())): groupNum = groupNum + 1 print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = matches.start(groupNum), end = matches.end(groupNum), group = matches.group(groupNum))) # Note: for Python 2.7 compatibility, use ur'' to prefix the regex and u"" to prefix the test string and substitution. ``` ## Substitution ## ### Full String Replacement ### ```python # coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r'^(__version__)(\s?=\s?)+("(.*)")' test_str = "__version__ = \"0.1.1.1\"" subst = "[Replacement]" # You can manually specify the number of replacements by changing the 4th argument result = re.sub(regex, subst, test_str, 1) if result: print (result) # Note: for Python 2.7 compatibility, use ur'' to prefix the regex and u"" to prefix the test string and substitution. ``` ### Dunder Replacement ### ```python # coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r'(__version__)(\s?=\s?)+("(.*)")' test_str = "__version__ = \"0.1.1.1\"" subst = "[Dunder-Replacement] \\g<3>" # You can manually specify the number of replacements by changing the 4th argument result = re.sub(regex, subst, test_str, 1) if result: print (result) # Note: for Python 2.7 compatibility, use ur'' to prefix the regex and u"" to prefix the test string and substitution. ``` ### Version Replacement ### ```python # coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r'(__version__)(\s?=\s?)+("(.*)")' test_str = "__version__ = \"0.1.1.1\"" subst = " \\g<1> = [Dunder-Replacement]" # You can manually specify the number of replacements by changing the 4th argument result = re.sub(regex, subst, test_str, 1) if result: print (result) # Note: for Python 2.7 compatibility, use ur'' to prefix the regex and u"" to prefix the test string and substitution. ```