Please enable JavaScript to use regex101
Regular
Expressions
101
Support Regex101
Social
Info
Regex Editor
Community Patterns
Account
Regex Quiz
Order By
Most Recent
Most upvotes
Most downvotes
Highest Score
Lowest Score
Filter by Flavor
PCRE2 (PHP)
ECMAScript (JavaScript)
Python
Golang
Java
.NET 7.0 (C#)
Rust
PCRE (Legacy)
Sponsors
There are currently no sponsors.
Become a sponsor today!
Community Patterns
Search among community submitted regex patterns...
0/512
3
Markdown Heading
Created
·
2021-12-14 21:41
Flavor
·
Java
Parses the text following a '#' and a space all the way up to the next return character. Additional #'s can be added for parsing of other type of headings!
Submitted by
Hansen
3
Regex tutorial
Created
·
2020-07-01 10:00
Updated
·
2023-07-20 07:05
Flavor
·
Java
Case insensitive match the whole word betwween \bword\b
Submitted by
anonymous
2
Check Email Validity
Created
·
2023-11-15 10:54
Updated
·
2023-11-15 17:35
Flavor
·
Java
Regular expression to check the email syntax validity. Certainly requires improvement, but it's a good basis to work from. Work with Java and JavaScript.
Submitted by
Alain TOMASIAN <alain.tomasian@kaptus.fr>
2
CSV
Created
·
2023-09-09 10:06
Flavor
·
Java
Crude CSV regex to split only by characters surrounded by non-whitespace characters. Ignore that it dosen't highlight all of the other commas in the editor. If you select the g regex flag it will properly show here, but not work in Java. Credit to @merosity (Merosity#0135) on Discord!
Submitted by
Merosity, regice202
2
Asciidoc PlantUML Block
Created
·
2022-03-15 13:11
Flavor
·
Java
Regex to select PlantUML Block in Asciidoc documents
Submitted by
anonymous
2
yyyy/mm/dd
Created
·
2021-08-25 12:40
Flavor
·
Java
^(((\d{3}1-9]|\d{2}[1-9]\d|\d[1-9]\d{2}|[1-9]\d{3})(\/)(((0[13578]|1[02])(\/)(0[1-9]|[12]\d|3[01]))|((0[469]|11)(\/)(0[1-9]|[12]\d|30))|(02(\/)(0[1-9]|[1]\d|2[0-8]))))|(((\d{2})(0[48]|[2468|13579)|((048]|[2468|3579)00))(\/)02(\/)29))$ Match year/month/day, date format. E.g: 2021/08/25 [match] 2021/09/30 [match] 2018/02/28 [match] 2024/02/29 [match] 2023/02/29 [mismatch]
Submitted by
mayl0421
2
Comparison of decimals with operators such as <, >, !=, ==, <>
Created
·
2021-03-13 14:23
Flavor
·
Java
Regex expression for comparing decimal numbers with the usual comparison operators such as (greater than), >= (greater than or equal to), != (not equal to), == (equal to), ... The regex also allows filtering of data from e.g. a database, whereby the first value is not needed, e.g. [FIELD] < 100
Submitted by
Florian Drees
1
Analyze movie and series episode torrent name
Created
·
2023-01-09 15:47
Updated
·
2023-01-09 15:48
Flavor
·
Java
Analyze whether the torrent name is a Movie or TV Episode Inspired from https://regex101.com/library/yP4bY4 There is two versions, see differences at the bottom Groups: Title (of the Movie/of the TV Series) Season (if TV Episode) Episode (if TV Episode) Year (if Movie) Name (only in v1, should match the TV Episode title if present) Release name (PROPER, REPACK, LIMITED, etc..) Resolution (720p, 1080p, etc..) Quality (HDTV, BluRay, WebRip, etc..) Codec (Xvid, x265, x264, etc..) Audio coding (AAC, AC3, DTS, etc...) Team (torrent group/team) Extension (mkv, avi, mp4, etc...) Versions: v1, include the TV Episode title, and have all the groups in a single match, but will misinterpret the "name" and "team" groups if the expected pattern is not respected (see in the test strings/regex rules) v2, does not include "name" group but is more reliable, will ignore unexpected patterns.
Submitted by
Hot Priest
1
Matching decimals in european format (dot as grouping separator, comma as decimal separator)
Created
·
2021-03-12 23:31
Updated
·
2021-03-14 17:43
Flavor
·
Java
A regex for validating decimal numbers in the European number format (in many parts of Europe at least, including Germany). A comma is used as a separator for the decimal number, a dot as a separator for thousand places.
Submitted by
Florian Drees
1
cApStAn OmegaT flagged / disallowed text
Created
·
2026-01-11 22:28
Flavor
·
Java
Flagged / disallowed text expression used in cApStAn's build of OmegaT
Submitted by
msoutopico
1
cApStAn OmegaT custom tags
Created
·
2026-01-11 22:26
Flavor
·
Java
Custom tags expression used in cApStAn's build of OmegaT
Submitted by
msoutopico
1
普罗米修斯解析匹配
Created
·
2025-09-27 07:04
Flavor
·
Java
"^([\w_]+)(?:\{(*)\})?\s+([\d\\.e+-]+)(?:\s+(\d+))?$"gm
Submitted by
umanan
1
OpenSearch + ElasticSearch minimum_should_match pattern
Created
·
2025-03-13 10:17
Flavor
·
Java
Validation pattern to validate the minimum_should_mach value in opensearch and elasticsearch queries. For more information on the minimum_should_match field have a look here for opensearch or here for elasticsearch
Submitted by
Hackante
1
vozuskia (cs/sk)
Created
·
2024-09-12 15:35
Flavor
·
Java
Addes a non-breaking space after any of the letters included in the [vozuskia] class.
Submitted by
Manuel Souto Pico
1
YouTube Video ID
Created
·
2024-05-20 13:58
Flavor
·
Java
Gets the ID of a YouTube Video from any link to it.
Submitted by
cheeseburger
1
Parse Address - Prefecture
Created
·
2024-03-20 03:46
Flavor
·
Java
get prefecture from Japanese address
Submitted by
Gary Ascuy
1
AWS EventBridge Scheduling Expressions
Created
·
2024-03-13 19:19
Updated
·
2024-04-25 23:00
Flavor
·
Java
This validates AWS EventBridge scheduling expressions using the rate() and cron() formats. It may not catch all invalid expressions, but it should properly validate all valid expressions, as demonstrated in the unit tests. Please let me know if I missed any valid expressions. Originally attempted this using named capture groups and named back-references to reduce duplication. Unfortunately, named capture support is tricky, so they were all converted to duplicated non-capturing groups instead.
Submitted by
Evan S Kaufman <evan@evanskaufman.com>
1
IANA Media Type
Created
·
2024-02-22 19:45
Flavor
·
Java
Parses an IANA Media Type value. Doesn't seem to capture repeating parameters, which is a bit of an edge case but valid I think - any suggestions on how to fix would be appreciated.
Submitted by
scottbdr
1
文件名称验证
Created
·
2023-12-01 16:03
Flavor
·
Java
操作系统文件名称验证,参考了Windows,Linux,Mac
Submitted by
腾龙问天
1
verifyIPV6
Created
·
2023-11-20 15:18
Flavor
·
Java
verificare indirizzo IPV6 (regole base)
Submitted by
Luigi Piccinni
1
Gradient for minecraft
Created
·
2023-11-14 09:00
Flavor
·
Java
This is for my plugin project
Submitted by
Trần Thế Anh
1
Youtube Video ID
Created
·
2023-10-18 07:16
Updated
·
2023-10-26 14:06
Flavor
·
Java
Extract youtube video ID
Submitted by
anonymous
1
Extract text strings from repeating text fields followed by a suffix
Created
·
2023-09-22 11:56
Flavor
·
Java
This regex expression is useful for extracting only the text string from a value in a column that may contain values from individual rows with repeat strings tagged with a suffix. For example - Row 1: "Sales (#1)", Row 2: "Sales Match (#2)". From the shared examples, this regex will extract the text "Sales" and "Sales Match."
Submitted by
nilotpalc
1
Match many cases of 8601
Created
·
2023-08-31 11:08
Updated
·
2023-08-31 14:32
Flavor
·
Java
This is still a working in progress Need to do Unit Tests and search for more use cases Match partial cases of 8601 such as: missing offset missing time only date and offset nano present or not (and being from 1 digit to 9 digits) Also properly captures the data by capturing only: year, month, date, hour, minute, second, nano and offset (be it 'Z' or '+02:00' or' +0200')
Submitted by
jpmand
1
Extract any link or endpoint
Created
·
2023-08-25 22:32
Updated
·
2023-08-27 08:35
Flavor
·
Java
Extract any link or endpoint from 1- HTML page source 2- HTTP responses 3- JS files Feel free to contact me on Telegram https://t.me/c4ir0 if you: are interested in discussing this regex need assistance with any regex-related queries want to challenge me (I'm enthusiastic about this part)
Submitted by
Cairo
1
html <Title>
Created
·
2023-08-09 16:02
Flavor
·
Java
htnle
Submitted by
erichologist
1
Riedler's 2nd URL regex
Created
·
2023-05-14 22:10
Flavor
·
Java
why did I make this?
Submitted by
Riedler
1
Türkiye Araç Plaka Regexi - Türkiye Car Plate Regex
Created
·
2023-04-24 20:44
Flavor
·
Java
Gist link for Java : https://gist.github.com/Gencturk-m/9962ce1e1dcf4dd9307062e34b023183 Aşağıdaki yapıdaki plakaları kabul eder: "01-81 X 9999", "01-81 X 99999" "01-81 XX 999", "01-81 XX 9999" "01-81 XXX 99" "01-81 XXX 999" **X: Türkçe'nin ÖÇŞİĞÜ hariç büyük harfleri. **Harfler ve sayılar arasında boşluk olmadan kabul eder. Boşluklu versiyonu gist linkinde var. **00, 000, 0000 ve 00000 ile bitenleri kabul etmez. **X: Turkish Capital Letters except ÖÇŞİĞÜ. **There is no white-space between letters and numbers. White-space version is in gist link. **Does not accept plates that ends with 00, 000, 0000 and 00000.
Submitted by
Melih Gençtürk - https://github.com/gencturk-m
1
json value extract
Created
·
2023-04-01 02:24
Flavor
·
Java
json value extract
Submitted by
anonymous
1
Email finder
Created
·
2023-03-27 23:58
Flavor
·
Java
Matches with the valid email addresses.
Submitted by
anonymous
1
Replace ^ with Math.pow function. Not made to work with braces.
Created
·
2023-03-15 22:00
Updated
·
2023-03-15 22:30
Flavor
·
Java
Replaces ^ with Math.pow function call. This assumes all braces have been combined first. If you need help with the combination, I got you—try this Python algorithm: def evaluate_braces(expr): """Recursively evaluate expressions within braces""" Check if expression contains braces if '(' in expr: Find the innermost set of braces left = expr.rfind('(') right = left + expr[left:].find(')') Evaluate the expression within the braces result = eval(expr[left+1:right]) Replace the expression within the braces with its result expr = expr[:left] + str(result) + expr[right+1:] Recursively evaluate any remaining expressions within braces expr = evaluate_braces(expr) Evaluate the final expression return expr expression = "31+((4+1)+27)2" result = evaluate_braces(expression) print(result) # Output: 2+2+3+4*8/2
Submitted by
Glitchii - https://github.com/Glitchii
1
AsciiDoc delimited block example
Created
·
2022-10-10 10:07
Updated
·
2022-10-10 10:08
Flavor
·
Java
https://docs.asciidoctor.org/asciidoc/latest/blocks/delimited/
Submitted by
aisbergde
1
phone number middle number parsing
Created
·
2022-09-26 05:32
Flavor
·
Java
middle number parsing regex
Submitted by
anonymous
1
IP Address
Created
·
2022-08-02 08:40
Flavor
·
Java
(^([0-9]{2,3}.)([0-9]{2,3}.)([0-9]{2,3}.)([0-9]{2,3})$)
Submitted by
anonymous
1
Regular expression for capturing dates and date ranges.
Created
·
2022-04-07 20:19
Flavor
·
Java
A proof of concept regex that captures dates and date ranges with a variety of separators. Works with both DMY and MDY, and if one is not needed, it can be easily deleted from the regex. The full variety of months needs to be implemented by the programmer themselves since developing it in regex101 is unfeasible and would clutter the regex.
Submitted by
Matey Krastev
1
Specific Year Dates (Regular Expression)
Created
·
2022-03-16 19:33
Flavor
·
Java
Here's a regular expression to handle a specific year in the different forms of dates: YYYY-MM-DD DD-MM-YYYY MM-DD-YYYY
Submitted by
loganmcampbell
1
9 Digit SSN String
Created
·
2022-03-16 19:30
Flavor
·
Java
If for whatever reason there isn't a delimiter within your data to for storing your SSNs you should be able to use this regular expression to capture 9 digit strings within data. You might need to add special keywords to filter out false positives.
Submitted by
loganmcampbell
1
Facebook IDs
Created
·
2022-03-16 19:27
Flavor
·
Java
A general regular expression that uses the keywords 'Facebook' and 'id' to collect strings that contain Facebook IDs. Also, added an additional condition to where if there's a long numeric string it will be match a group given that, 'Facebook' is within the string. This is a special use-case and can be removed, I believe group 2.
Submitted by
loganmcampbell
1
Matching build file names
Created
·
2022-02-16 22:31
Flavor
·
Java
Matches various versions of build file filenames from our jenkins builds
Submitted by
Sean Furrh
1
匹配中英文括号
Created
·
2022-02-10 06:46
Flavor
·
Java
可以用来替换企业名称中的中英文括号 eg: 阿里巴巴(中国)股份 阿里巴巴(中国)股份
Submitted by
tuan_luo
1
Android Package Validation - Java Regex
Created
·
2022-02-06 06:30
Flavor
·
Java
Note: replace the "\." with "\\." if you paste this on your java. The regex will match if the package name is valid. example: my.new.hello.world.app Supports: a-z 0-9 and underscore Supports multiple dots
Submitted by
dlv_dls2
1
Rick Roll
Created
·
2022-02-01 19:56
Flavor
·
Java
Matches chorus of Never Going to Give You Up
Submitted by
Stephen Battista
1
IPv4 + TCP-Port
Created
·
2022-01-12 07:59
Flavor
·
Java
This regex matches a IPv4 with a TCP Port (1-65535) Example: 192.168.0.69:1337 will match and have the groups: Group 1: 192.168.0.69 Group 2: 1337
Submitted by
SIMULATAN
1
11
Created
·
2021-10-15 07:02
Flavor
·
Java
11
Submitted by
11
1
Match Windows filename in any path but only C: D: and F: drives
Created
·
2021-10-02 18:55
Flavor
·
Java
Used for Service Discovery in vRealize Operations. Use case is a service that can be installed on any path, but we only want to discover and monitor services installed on standard production drives (C, D or F). Filename will always be the same.
Submitted by
Various
1
sfdgvsdgdfg
Created
·
2021-07-07 21:18
Flavor
·
Java
dgfdgdf
Submitted by
anonymous
1
标点
Created
·
2021-07-04 12:33
Flavor
·
Java
匹配大部分标点
Submitted by
anonymous
1
css attribute validation
Created
·
2021-06-24 18:00
Flavor
·
Java
css attribute validation
Submitted by
arnab
1
MBI Format
Created
·
2021-05-30 05:30
Updated
·
2021-05-30 05:38
Flavor
·
Java
Medicare Beneficiary Identifier (MBI) Format https://www.cms.gov/medicare/new-medicare-card/understanding-the-mbi-with-format.pdf
Submitted by
Chee Cheng
1
Match segmented paths with '\' and '/' escaped by '\'
Created
·
2021-05-18 14:43
Flavor
·
Java
Match segmented paths with '\' and '/' escaped by '\'
Submitted by
anonymous
Load More
Community Library Entry
0
Regular Expression
Created
·
2020-05-29 17:38
Flavor
·
PCRE (Legacy)
/
^
[
A
-
Z
][
a
-
z,ą,ż,ś,ź,ę,ć,ń,ó,ł
]
+
\s
[
A
-
Z
][
a
-
z,ą,ż,ś,ź,ę,ć,ń,ó,ł
]
+
(
-
[
A
-
Z
][
a
-
z,ą,ż,ś,ź,ę,ć,ń,ó,ł
]
+
)*
$
/
gm
Open regex in editor
Description
no description available
Submitted by
anonymous