Regular Expressions 101

@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?

Save & Share

  • Save Regex
    ctrl+s
  • Update Regex
    ctrl+⇧+s

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python 2.7
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
\.(7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip)$
/
g
\. matches the character . literally (case sensitive)
1st Capturing Group
(7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip)
1st Alternative
7z
7z matches the characters 7z literally (case sensitive)
2nd Alternative
aac
aac matches the characters aac literally (case sensitive)
3rd Alternative
arc
arc matches the characters arc literally (case sensitive)
4th Alternative
arj
arj matches the characters arj literally (case sensitive)
5th Alternative
asf
asf matches the characters asf literally (case sensitive)
6th Alternative
asx
asx matches the characters asx literally (case sensitive)
7th Alternative
avi
avi matches the characters avi literally (case sensitive)
8th Alternative
bin
9th Alternative
csv
10th Alternative
doc(x|m)?
11th Alternative
dot(x|m)?
12th Alternative
exe
13th Alternative
flv
14th Alternative
gif
15th Alternative
gz
16th Alternative
gzip
17th Alternative
hqx
18th Alternative
jar
19th Alternative
jpe?g
20th Alternative
js
21st Alternative
mp(2|3|4|e?g)
22nd Alternative
mov(ie)?
23rd Alternative
msi
24th Alternative
msp
25th Alternative
pdf
26th Alternative
phps
27th Alternative
png
28th Alternative
ppt(x|m)?
29th Alternative
pot(x|m)?
30th Alternative
pps(x|m)?
31st Alternative
ppam
32nd Alternative
sld(x|m)?
33rd Alternative
thmx
34th Alternative
qtm?
35th Alternative
ra(m|r)?
36th Alternative
sea
37th Alternative
sit
38th Alternative
tar
39th Alternative
tgz
40th Alternative
torrent
41st Alternative
txt
42nd Alternative
wav
43rd Alternative
wma
44th Alternative
wmv
45th Alternative
wpd
46th Alternative
xls(x|m|b)?
47th Alternative
xlt(x|m)
48th Alternative
xlam
49th Alternative
xml
50th Alternative
z
51st Alternative
zip
$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
g

Test String

Regex Debugger

Please wait while your expression is being debugged...