Please enable JavaScript to use this web application.
Regular
Expressions
101
Social
Social
Join the Discord community!
Follow me on twitter!
Send me an email
Donate
Donate
Donate through Paypal
Become a Github Sponsor
Info
Info
Find out what's new!
RegEx101 Wiki
Report bugs or make suggestions
What's new?
Loading content...
Close
Regex Editor
Regex Editor
Community Patterns
Community Patterns
Account
Account
Regex Quiz
Regex Quiz
Settings
Settings
Live Help
Live Help
Get help on Discord
Get help on IRC
Order By
Most Recent
Highest Score
Lowest Score
Most upvotes
Most downvotes
Filter by Flavor
PCRE2 (PHP >=7.3)
PCRE (PHP <7.3)
ECMAScript (JavaScript)
Python
Golang
Java 8
.NET (C#)
Rust
Sponsors
Community Patterns
Search among 11,660 community submitted regex patterns...
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Tratamento DUE - DRAFT BL
PCRE2 (PHP >=7.3)
expressão pra verificar a presença da informação da DUE no Draft
Submitted by
anonymous
-
10 months ago
2023-02-03 19:34
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
c++ function signature
PCRE2 (PHP >=7.3)
c++ function signature
Submitted by
anonymous
-
10 months ago
2023-02-03 15:13
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Twitter Question
PCRE2 (PHP >=7.3)
Gramática: S->E S->aA S->bB A->E A->bB...
Submitted by
anonymous
-
10 months ago
2023-02-02 21:23
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
User-Agent
PCRE (PHP <7.3)
Parser
Submitted by
sn3kdev
-
10 months ago
2023-02-02 21:06
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Xml Element Attributes
PCRE2 (PHP >=7.3)
View attributes for an XML or HTML element
Submitted by
anonymous
-
10 months ago
2023-02-02 15:01
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Match between two strings
PCRE2 (PHP >=7.3)
(?<=This is)(.*)(?=sentence)
Submitted by
anonymous
-
10 months ago
2023-02-02 14:33
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
/^([a-z]).*\1$|^[a-z]{1}$/gm
PCRE2 (PHP >=7.3)
regex that will test string that begins and end with the same string character and also works if there is only one character in string
Submitted by
Ananya
-
10 months ago
2023-02-02 09:31
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
wiki
PCRE2 (PHP >=7.3)
wiki parser
Submitted by
anonymous
-
10 months ago
2023-02-02 04:26
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Remove extra/useless python elements for GPT input.
PCRE2 (PHP >=7.3)
This RegEx removes unused elements such as inline comments and blank lines in python code. This will save you tokens and time when using GPT-3+ or ChatGPT to help code and debug.
Submitted by
LukeL
-
10 months ago
2023-02-01 19:16
(Last modified 10 months ago)
2023-02-02 00:41
2
2 upvotes, 0 downvotes (score 34.2%) (You must be signed in to vote)
Palindromes
PCRE2 (PHP >=7.3)
Matches palindromes: arbitrary length ignores non-significant characters (spaces, ponctuation) ignores accents, provided the text is NFD-normalized recursive palindromes (e.g. "a été à"): either match the longest one ("a été à") or the nested ones individually ("a", "été", "à") (see comment)
Submitted by
NicolaF_
-
10 months ago
2023-02-01 17:47
(Last modified 10 months ago)
2023-02-02 08:27
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
pythonize beautiful query
PCRE2 (PHP >=7.3)
pythonize beautiful query
Submitted by
anonymous
-
10 months ago
2023-02-01 16:14
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Extract any http https and any url form
PCRE (PHP <7.3)
This will help you to extract any URL inside your text
Submitted by
Abdullah Alweheid
-
10 months ago
2023-01-31 22:18
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Parcing2
PCRE (PHP <7.3)
aa
Submitted by
anonymous
-
10 months ago
2023-01-31 20:03
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Get path from any text
PCRE2 (PHP >=7.3)
Get path (windows style) from any type of text (error message, e-mail corps ...), quoted or not. THIS IS COMMENTED VERSION !_ to simple copy and use it, go https://regex101.com/r/zWGLMP Relative path are not supported...
Submitted by
nitrateag
-
10 months ago
2023-01-31 14:39
(Last modified 7 months ago)
2023-05-04 12:23
13
15 upvotes, 2 downvotes (score 72.2%) (You must be signed in to vote)
Get path from any text
Recommended
This entry has been specifically selected by our team to be a great submission
PCRE2 (PHP >=7.3)
Get path (windows style) from any type of text (error message, e-mail corps ...), quoted or not. THIS IS THE SINGLE LINE VERSION !_ If you want understand how it work or edit it, go https://regex101.com/r/7o2fyy Relative path are not supported...
Submitted by
nitrateag
-
10 months ago
2023-01-31 14:38
(Last modified 5 months ago)
2023-07-23 20:17
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Youtube API V3 Video list convert duration
PCRE2 (PHP >=7.3)
Convert the YouTube API V3 videos list, duration of videos to separate numbers for calculations.
Submitted by
Bo
-
10 months ago
2023-01-31 13:39
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
trim phone number
PCRE (PHP <7.3)
trim phone number
Submitted by
anonymous
-
10 months ago
2023-01-31 12:39
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Capture optional HTML tag attributes in any order
PCRE2 (PHP >=7.3)
We often see some regular expressions to manipulate HTML instead of using a DOM parser. But well, in some cases we haven't got the parser or efficiency is a question of concern. In most cases I think the best is to use both together. First a simple and bullet-proof regex to extract data from the HTM...
Submitted by
Patrick Janser
-
10 months ago
2023-01-31 08:47
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
log timestamp
Golang
extract time stamp from log entry
Submitted by
anonymous
-
10 months ago
2023-01-30 15:42
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Match HTML comments with nested comments
PCRE (PHP <7.3)
Even if this is not valid HTML, it's more to understand the concept of recursion in patterns. It was an answer to a Stack overflow question: https://stackoverflow.com/questions/75282404/remove-comments-from-some-generated-html-which-can-be-invalid-with-nested-commen The idea is to use PCRE's recur...
Submitted by
Patrick Janser
-
10 months ago
2023-01-30 13:50
1
...
30
31
32
33
34
35
36
...
583
frequency
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Regular Expression
PCRE2 (PHP >=7.3)
/
^\d
+
(
(
,
\d
)?
(
-
(
\d
+
)?
(
,
\d
)?
)?
)?
$
/
gm
Open regex in editor
Description
Loading markdown...
Submitted by
hieppp
-
a year ago
2022-12-19 04:36