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)
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
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Search Trailing Commas
PCRE (PHP <7.3)
Regex used for finding trailing commas. Use for troubleshooting PHP 7.2 Codes
Submitted by
anonymous
-
10 months ago
2023-01-30 11:13
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Math any kind of letter
PCRE2 (PHP >=7.3)
Just a quick example of the \p{L} pattern
Submitted by
anonymous
-
10 months ago
2023-01-30 02:12
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Storyblok Assets
PCRE2 (PHP >=7.3)
Match paths for a.storyblok.com
Submitted by
anonymous
-
10 months ago
2023-01-28 09:39
(Last modified 10 months ago)
2023-01-28 09:39
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Init code
PCRE2 (PHP >=7.3)
Init code
Submitted by
anonymous
-
10 months ago
2023-01-27 22:11
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
find all wikipedia links in a text
PCRE2 (PHP >=7.3)
a regex that finds all expressions that start with "(https://en.wikipedia.org/wiki" and end with a closing bracket.
Submitted by
David
-
10 months ago
2023-01-27 11:23
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Start with t or T and some number and End with <String>
PCRE2 (PHP >=7.3)
Some custom pattern matching where a string start with t and end with any string, for example - t123_click, t1234_click_submit, T12_click_click_skip
Submitted by
Jaswinder
-
10 months ago
2023-01-27 10:08
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
patternmatching
PCRE2 (PHP >=7.3)
pattern to ensure keywords are picked up if words on either side
Submitted by
anonymous
-
10 months ago
2023-01-27 10:01
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
PCRE destination filename matcher
PCRE2 (PHP >=7.3)
Matches the most advanced filename for a given version as per my file naming conventions.
Submitted by
Robert Larkins
-
10 months ago
2023-01-26 13:43
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
PSMFC-ELogUserRegex
PCRE2 (PHP >=7.3)
allow simple usernames starting with a letter, containing . - and _ or an email
Submitted by
anonymous
-
10 months ago
2023-01-25 19:39
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
AAU CPR validation (more rebust)
PCRE2 (PHP >=7.3)
This one makes sure to not match 31 in months where it does not exist and cuts off february at 28. Might need to do special check for 29th of february ..?
Submitted by
anonymous
-
10 months ago
2023-01-25 11:33
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
DK CPR Validation
PCRE2 (PHP >=7.3)
Checks in input for matching social security numbers in Denmark
Submitted by
Found online
-
10 months ago
2023-01-25 09:41
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
C Macros
PCRE2 (PHP >=7.3)
Regular expression to match C macros specified with the #define directive.
Submitted by
Alejandro
-
10 months ago
2023-01-25 08:53
(Last modified 10 months ago)
2023-01-25 10:50
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
regex for del
PCRE2 (PHP >=7.3)
Deletes all .dta and .dba files that one wants within a directory
Submitted by
anonymous
-
10 months ago
2023-01-25 03:15
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
semantic-release
PCRE2 (PHP >=7.3)
Teste semantic release
Submitted by
leonardo.mendes
-
10 months ago
2023-01-24 20:54
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
myspace
PCRE2 (PHP >=7.3)
myspace
Submitted by
anonymous
-
10 months ago
2023-01-24 16:16
1
...
30
31
32
33
34
35
36
...
583
Remove leading and trailing zeros from decimal numbers
0
0 upvotes, 0 downvotes (score 0%) (You must be signed in to vote)
Regular Expression
PCRE2 (PHP >=7.3)
/
0
*
(
\d
+
\.
0
?
\d
*
?
)
0
*
(
\D
|
$
)
/
gm
Open regex in editor
Description
Loading markdown...
Submitted by
asasine
-
a year ago
2022-12-15 16:18
(Last modified a year ago)
2022-12-15 17:11