Regular Expressions 101

Save & Share

  • Regex Version: ver. 1
  • Update Regex
    ctrl+⇧+s
  • Save new Regex
    ctrl+s
  • Add to Community Library

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression
No Match

/
/
gm

Test String

Code Generator

Generated Code

const regex = /application\/.*?(?:msword|x-ms|vnd\.ms-|officedocument)/gm; // Alternative syntax using RegExp constructor // const regex = new RegExp('application\\\/.*?(?:msword|x-ms|vnd\\.ms-|officedocument)', 'gm') const str = `application/vnd.hzn-3d-crossword .x3d 3D Crossword Plugin video/3gpp .3gp 3GP video/3gpp2 .3g2 3GP2 application/vnd.mseq .mseq 3GPP MSEQ File application/vnd.3m.post-it-notes .pwn 3M Post It Notes application/vnd.3gpp.pic-bw-large .plb 3rd Generation Partnership Project - Pic Large application/vnd.3gpp.pic-bw-small .psb 3rd Generation Partnership Project - Pic Small application/vnd.3gpp.pic-bw-var .pvb 3rd Generation Partnership Project - Pic Var application/vnd.3gpp2.tcap .tcap 3rd Generation Partnership Project - Transaction Capabilities Application Part application/x-7z-compressed .7z 7-Zip application/x-abiword .abw AbiWord application/x-ace-compressed .ace Ace Archive application/vnd.americandynamics.acc .acc Active Content Compression application/vnd.acucobol .acu ACU Cobol application/vnd.acucorp .atc ACU Cobol audio/adpcm .adp Adaptive differential pulse-code modulation application/x-authorware-bin .aab Adobe (Macropedia) Authorware - Binary File application/x-authorware-map .aam Adobe (Macropedia) Authorware - Map application/x-authorware-seg .aas Adobe (Macropedia) Authorware - Segment File application/vnd.adobe.air-application-installer-package+zip .air Adobe AIR Application application/x-shockwave-flash .swf Adobe Flash application/vnd.adobe.fxp .fxp Adobe Flex Project application/pdf .pdf Adobe Portable Document Format application/vnd.cups-ppd .ppd Adobe PostScript Printer Description File Format application/x-director .dir Adobe Shockwave Player application/vnd.adobe.xdp+xml .xdp Adobe XML Data Package application/vnd.adobe.xfdf .xfdf Adobe XML Forms Data Format audio/x-aac .aac Advanced Audio Coding (AAC) application/vnd.ahead.space .ahead Ahead AIR Application application/vnd.airzip.filesecure.azf .azf AirZip FileSECURE application/vnd.airzip.filesecure.azs .azs AirZip FileSECURE application/vnd.amazon.ebook .azw Amazon Kindle eBook format application/vnd.amiga.ami .ami AmigaDE application/andrew-inset N/A Andrew Toolkit application/vnd.android.package-archive .apk Android Package Archive application/vnd.anser-web-certificate-issue-initiation .cii ANSER-WEB Terminal Client - Certificate Issue application/vnd.anser-web-funds-transfer-initiation .fti ANSER-WEB Terminal Client - Web Funds Transfer application/vnd.antix.game-component .atx Antix Game Player application/vnd.apple.installer+xml .mpkg Apple Installer Package application/applixware .aw Applixware application/vnd.hhe.lesson-player .les Archipelago Lesson Player application/vnd.aristanetworks.swi .swi Arista Networks Software Image text/x-asm .s Assembler Source File application/atomcat+xml .atomcat Atom Publishing Protocol application/atomsvc+xml .atomsvc Atom Publishing Protocol Service Document application/atom+xml .atom, .xml Atom Syndication Format application/pkix-attr-cert .ac Attribute Certificate audio/x-aiff .aif Audio Interchange File Format video/x-msvideo .avi Audio Video Interleave (AVI) application/vnd.audiograph .aep Audiograph image/vnd.dxf .dxf AutoCAD DXF model/vnd.dwf .dwf Autodesk Design Web Format (DWF) text/plain-bas .par BAS Partitur Format application/x-bcpio .bcpio Binary CPIO Archive application/octet-stream .bin Binary Data image/bmp .bmp Bitmap Image File application/x-bittorrent .torrent BitTorrent application/vnd.rim.cod .cod Blackberry COD File application/vnd.blueice.multipass .mpm Blueice Research Multipass application/vnd.bmi .bmi BMI Drawing Data Interchange application/x-sh .sh Bourne Shell Script image/prs.btif .btif BTIF application/vnd.businessobjects .rep BusinessObjects application/x-bzip .bz Bzip Archive application/x-bzip2 .bz2 Bzip2 Archive application/x-csh .csh C Shell Script text/x-c .c C Source File application/vnd.chemdraw+xml .cdxml CambridgeSoft Chem Draw text/css .css Cascading Style Sheets (CSS) chemical/x-cdx .cdx ChemDraw eXchange file chemical/x-cml .cml Chemical Markup Language chemical/x-csml .csml Chemical Style Markup Language application/vnd.contact.cmsg .cdbcmsg CIM Database application/vnd.claymore .cla Claymore Data Files application/vnd.clonk.c4group .c4g Clonk Game image/vnd.dvb.subtitle .sub Close Captioning - Subtitle application/cdmi-capability .cdmia Cloud Data Management Interface (CDMI) - Capability application/cdmi-container .cdmic Cloud Data Management Interface (CDMI) - Contaimer application/cdmi-domain .cdmid Cloud Data Management Interface (CDMI) - Domain application/cdmi-object .cdmio Cloud Data Management Interface (CDMI) - Object application/cdmi-queue .cdmiq Cloud Data Management Interface (CDMI) - Queue application/vnd.cluetrust.cartomobile-config .c11amc ClueTrust CartoMobile - Config application/vnd.cluetrust.cartomobile-config-pkg .c11amz ClueTrust CartoMobile - Config Package image/x-cmu-raster .ras CMU Image model/vnd.collada+xml .dae COLLADA text/csv .csv Comma-Seperated Values application/mac-compactpro .cpt Compact Pro application/vnd.wap.wmlc .wmlc Compiled Wireless Markup Language (WMLC) image/cgm .cgm Computer Graphics Metafile x-conference/x-cooltalk .ice CoolTalk image/x-cmx .cmx Corel Metafile Exchange (CMX) application/vnd.xara .xar CorelXARA application/vnd.cosmocaller .cmc CosmoCaller application/x-cpio .cpio CPIO Archive application/vnd.crick.clicker .clkx CrickSoftware - Clicker application/vnd.crick.clicker.keyboard .clkk CrickSoftware - Clicker - Keyboard application/vnd.crick.clicker.palette .clkp CrickSoftware - Clicker - Palette application/vnd.crick.clicker.template .clkt CrickSoftware - Clicker - Template application/vnd.crick.clicker.wordbank .clkw CrickSoftware - Clicker - Wordbank application/vnd.criticaltools.wbs+xml .wbs Critical Tools - PERT Chart EXPERT application/vnd.rig.cryptonote .cryptonote CryptoNote chemical/x-cif .cif Crystallographic Interchange Format chemical/x-cmdf .cmdf CrystalMaker Data Format application/cu-seeme .cu CU-SeeMe application/prs.cww .cww CU-Writer text/vnd.curl .curl Curl - Applet text/vnd.curl.dcurl .dcurl Curl - Detached Applet text/vnd.curl.mcurl .mcurl Curl - Manifest File text/vnd.curl.scurl .scurl Curl - Source Code application/vnd.curl.car .car CURL Applet application/vnd.curl.pcurl .pcurl CURL Applet application/vnd.yellowriver-custom-menu .cmp CustomMenu application/dssc+der .dssc Data Structure for the Security Suitability of Cryptographic Algorithms application/dssc+xml .xdssc Data Structure for the Security Suitability of Cryptographic Algorithms application/x-debian-package .deb Debian Package audio/vnd.dece.audio .uva DECE Audio image/vnd.dece.graphic .uvi DECE Graphic video/vnd.dece.hd .uvh DECE High Definition Video video/vnd.dece.mobile .uvm DECE Mobile Video video/vnd.uvvu.mp4 .uvu DECE MP4 video/vnd.dece.pd .uvp DECE PD Video video/vnd.dece.sd .uvs DECE SD Video video/vnd.dece.video .uvv DECE Video application/x-dvi .dvi Device Independent File Format (DVI) application/vnd.fdsn.seed .seed Digital Siesmograph Networks - SEED Datafiles application/x-dtbook+xml .dtb Digital Talking Book application/x-dtbresource+xml .res Digital Talking Book - Resource File application/vnd.dvb.ait .ait Digital Video Broadcasting application/vnd.dvb.service .svc Digital Video Broadcasting audio/vnd.digital-winds .eol Digital Winds Music image/vnd.djvu .djvu DjVu application/xml-dtd .dtd Document Type Definition application/vnd.dolby.mlp .mlp Dolby Meridian Lossless Packing application/x-doom .wad Doom Video Game application/vnd.dpgraph .dpg DPGraph audio/vnd.dra .dra DRA Audio application/vnd.dreamfactory .dfac DreamFactory audio/vnd.dts .dts DTS Audio audio/vnd.dts.hd .dtshd DTS High Definition Audio image/vnd.dwg .dwg DWG Drawing application/vnd.dynageo .geo DynaGeo application/ecmascript .es ECMAScript application/vnd.ecowin.chart .mag EcoWin Chart image/vnd.fujixerox.edmics-mmr .mmr EDMICS 2000 image/vnd.fujixerox.edmics-rlc .rlc EDMICS 2000 application/exi .exi Efficient XML Interchange application/vnd.proteus.magazine .mgz EFI Proteus application/epub+zip .epub Electronic Publication message/rfc822 .eml Email Message application/vnd.enliven .nml Enliven Viewer application/vnd.is-xpr .xpr Express by Infoseek image/vnd.xiff .xif eXtended Image File Format (XIFF) application/vnd.xfdl .xfdl Extensible Forms Description Language application/emma+xml .emma Extensible MultiModal Annotation application/vnd.ezpix-album .ez2 EZPix Secure Photo Album application/vnd.ezpix-package .ez3 EZPix Secure Photo Album image/vnd.fst .fst FAST Search & Transfer ASA video/vnd.fvt .fvt FAST Search & Transfer ASA image/vnd.fastbidsheet .fbs FastBid Sheet application/vnd.denovo.fcselayout-link .fe_launch FCS Express Layout Link video/x-f4v .f4v Flash Video video/x-flv .flv Flash Video image/vnd.fpx .fpx FlashPix image/vnd.net-fpx .npx FlashPix text/vnd.fmi.flexstor .flx FLEXSTOR video/x-fli .fli FLI/FLC Animation Format application/vnd.fluxtime.clip .ftc FluxTime Clip application/vnd.fdf .fdf Forms Data Format text/x-fortran .f Fortran Source File application/vnd.mif .mif FrameMaker Interchange Format application/vnd.framemaker .fm FrameMaker Normal Format image/x-freehand .fh FreeHand MX application/vnd.fsc.weblaunch .fsc Friendly Software Corporation application/vnd.frogans.fnc .fnc Frogans Player application/vnd.frogans.ltf .ltf Frogans Player application/vnd.fujixerox.ddd .ddd Fujitsu - Xerox 2D CAD Data application/vnd.fujixerox.docuworks .xdw Fujitsu - Xerox DocuWorks application/vnd.fujixerox.docuworks.binder .xbd Fujitsu - Xerox DocuWorks Binder application/vnd.fujitsu.oasys .oas Fujitsu Oasys application/vnd.fujitsu.oasys2 .oa2 Fujitsu Oasys application/vnd.fujitsu.oasys3 .oa3 Fujitsu Oasys application/vnd.fujitsu.oasysgp .fg5 Fujitsu Oasys application/vnd.fujitsu.oasysprs .bh2 Fujitsu Oasys application/x-futuresplash .spl FutureSplash Animator application/vnd.fuzzysheet .fzs FuzzySheet image/g3fax .g3 G3 Fax Image application/vnd.gmx .gmx GameMaker ActiveX model/vnd.gtw .gtw Gen-Trix Studio application/vnd.genomatix.tuxedo .txd Genomatix Tuxedo Framework application/vnd.geogebra.file .ggb GeoGebra application/vnd.geogebra.tool .ggt GeoGebra model/vnd.gdl .gdl Geometric Description Language (GDL) application/vnd.geometry-explorer .gex GeoMetry Explorer application/vnd.geonext .gxt GEONExT and JSXGraph application/vnd.geoplan .g2w GeoplanW application/vnd.geospace .g3w GeospacW application/x-font-ghostscript .gsf Ghostscript Font application/x-font-bdf .bdf Glyph Bitmap Distribution Format application/x-gtar .gtar GNU Tar Files application/x-texinfo .texinfo GNU Texinfo Document application/x-gnumeric .gnumeric Gnumeric application/vnd.google-earth.kml+xml .kml Google Earth - KML application/vnd.google-earth.kmz .kmz Google Earth - Zipped KML application/vnd.grafeq .gqf GrafEq image/gif .gif Graphics Interchange Format text/vnd.graphviz .gv Graphviz application/vnd.groove-account .gac Groove - Account application/vnd.groove-help .ghf Groove - Help application/vnd.groove-identity-message .gim Groove - Identity Message application/vnd.groove-injector .grv Groove - Injector application/vnd.groove-tool-message .gtm Groove - Tool Message application/vnd.groove-tool-template .tpl Groove - Tool Template application/vnd.groove-vcard .vcg Groove - Vcard video/h261 .h261 H.261 video/h263 .h263 H.263 video/h264 .h264 H.264 application/vnd.hp-hpid .hpid Hewlett Packard Instant Delivery application/vnd.hp-hps .hps Hewlett-Packard's WebPrintSmart application/x-hdf .hdf Hierarchical Data Format audio/vnd.rip .rip Hit'n'Mix application/vnd.hbci .hbci Homebanking Computer Interface (HBCI) application/vnd.hp-jlyt .jlt HP Indigo Digital Press - Job Layout Languate application/vnd.hp-pcl .pcl HP Printer Command Language application/vnd.hp-hpgl .hpgl HP-GL/2 and HP RTL application/vnd.yamaha.hv-script .hvs HV Script application/vnd.yamaha.hv-dic .hvd HV Voice Dictionary application/vnd.yamaha.hv-voice .hvp HV Voice Parameter application/vnd.hydrostatix.sof-data .sfd-hdstx Hydrostatix Master Suite application/hyperstudio .stk Hyperstudio application/vnd.hal+xml .hal Hypertext Application Language text/html .html HyperText Markup Language (HTML) application/vnd.ibm.rights-management .irm IBM DB2 Rights Manager application/vnd.ibm.secure-container .sc IBM Electronic Media Management System - Secure Container text/calendar .ics iCalendar application/vnd.iccprofile .icc ICC profile image/x-icon .ico Icon Image application/vnd.igloader .igl igLoader image/ief .ief Image Exchange Format application/vnd.immervision-ivp .ivp ImmerVision PURE Players application/vnd.immervision-ivu .ivu ImmerVision PURE Players application/reginfo+xml .rif IMS Networks text/vnd.in3d.3dml .3dml In3D - 3DML text/vnd.in3d.spot .spot In3D - 3DML model/iges .igs Initial Graphics Exchange Specification (IGES) application/vnd.intergeo .i2g Interactive Geometry Software application/vnd.cinderella .cdy Interactive Geometry Software Cinderella application/vnd.intercon.formnet .xpw Intercon FormNet application/vnd.isac.fcs .fcs International Society for Advancement of Cytometry application/ipfix .ipfix Internet Protocol Flow Information Export application/pkix-cert .cer Internet Public Key Infrastructure - Certificate application/pkixcmp .pki Internet Public Key Infrastructure - Certificate Management Protocole application/pkix-crl .crl Internet Public Key Infrastructure - Certificate Revocation Lists application/pkix-pkipath .pkipath Internet Public Key Infrastructure - Certification Path application/vnd.insors.igm .igm IOCOM Visimeet application/vnd.ipunplugged.rcprofile .rcprofile IP Unplugged Roaming Client application/vnd.irepository.package+xml .irp iRepository / Lucidoc Editor text/vnd.sun.j2me.app-descriptor .jad J2ME App Descriptor application/java-archive .jar Java Archive application/java-vm .class Java Bytecode File application/x-java-jnlp-file .jnlp Java Network Launching Protocol application/java-serialized-object .ser Java Serialized Object text/x-java-source,java .java Java Source File application/javascript .js JavaScript application/json .json JavaScript Object Notation (JSON) application/vnd.joost.joda-archive .joda Joda Archive video/jpm .jpm JPEG 2000 Compound Image File Format image/jpeg .jpeg, .jpg JPEG Image image/x-citrix-jpeg .jpeg, .jpg JPEG Image (Citrix client) image/pjpeg .pjpeg JPEG Image (Progressive) video/jpeg .jpgv JPGVideo application/vnd.kahootz .ktz Kahootz application/vnd.chipnuts.karaoke-mmd .mmd Karaoke on Chipnuts Chipsets application/vnd.kde.karbon .karbon KDE KOffice Office Suite - Karbon application/vnd.kde.kchart .chrt KDE KOffice Office Suite - KChart application/vnd.kde.kformula .kfo KDE KOffice Office Suite - Kformula application/vnd.kde.kivio .flw KDE KOffice Office Suite - Kivio application/vnd.kde.kontour .kon KDE KOffice Office Suite - Kontour application/vnd.kde.kpresenter .kpr KDE KOffice Office Suite - Kpresenter application/vnd.kde.kspread .ksp KDE KOffice Office Suite - Kspread application/vnd.kde.kword .kwd KDE KOffice Office Suite - Kword application/vnd.kenameaapp .htke Kenamea App application/vnd.kidspiration .kia Kidspiration application/vnd.kinar .kne Kinar Applications application/vnd.kodak-descriptor .sse Kodak Storyshare application/vnd.las.las+xml .lasxml Laser App Enterprise application/x-latex .latex LaTeX application/vnd.llamagraphics.life-balance.desktop .lbd Life Balance - Desktop Edition application/vnd.llamagraphics.life-balance.exchange+xml .lbe Life Balance - Exchange Format application/vnd.jam .jam Lightspeed Audio Lab application/vnd.lotus-1-2-3 .123 Lotus 1-2-3 application/vnd.lotus-approach .apr Lotus Approach application/vnd.lotus-freelance .pre Lotus Freelance application/vnd.lotus-notes .nsf Lotus Notes application/vnd.lotus-organizer .org Lotus Organizer application/vnd.lotus-screencam .scm Lotus Screencam application/vnd.lotus-wordpro .lwp Lotus Wordpro audio/vnd.lucent.voice .lvp Lucent Voice audio/x-mpegurl .m3u M3U (Multimedia Playlist) video/x-m4v .m4v M4v application/mac-binhex40 .hqx Macintosh BinHex 4.0 application/vnd.macports.portpkg .portpkg MacPorts Port System application/vnd.osgeo.mapguide.package .mgp MapGuide DBXML application/marc .mrc MARC Formats application/marcxml+xml .mrcx MARC21 XML Schema application/mxf .mxf Material Exchange Format application/vnd.wolfram.player .nbp Mathematica Notebook Player application/mathematica .ma Mathematica Notebooks application/mathml+xml .mathml Mathematical Markup Language application/mbox .mbox Mbox database files application/vnd.medcalcdata .mc1 MedCalc application/mediaservercontrol+xml .mscml Media Server Control Markup Language application/vnd.mediastation.cdkey .cdkey MediaRemote application/vnd.mfer .mwf Medical Waveform Encoding Format application/vnd.mfmp .mfm Melody Format for Mobile Platform model/mesh .msh Mesh Data Type application/mads+xml .mads Metadata Authority Description Schema application/mets+xml .mets Metadata Encoding and Transmission Standard application/mods+xml .mods Metadata Object Description Schema application/metalink4+xml .meta4 Metalink application/vnd.mcd .mcd Micro CADAM Helix D&D application/vnd.micrografx.flo .flo Micrografx application/vnd.micrografx.igx .igx Micrografx iGrafx Professional application/vnd.eszigno3+xml .es3 MICROSEC e-Szign½ application/x-msaccess .mdb Microsoft Access video/x-ms-asf .asf Microsoft Advanced Systems Format (ASF) application/x-msdownload .exe Microsoft Application application/vnd.ms-artgalry .cil Microsoft Artgalry application/vnd.ms-cab-compressed .cab Microsoft Cabinet File application/vnd.ms-ims .ims Microsoft Class Server application/x-ms-application .application Microsoft ClickOnce application/x-msclip .clp Microsoft Clipboard Clip image/vnd.ms-modi .mdi Microsoft Document Imaging Format application/vnd.ms-fontobject .eot Microsoft Embedded OpenType application/vnd.ms-excel .xls Microsoft Excel application/vnd.ms-excel.addin.macroenabled.12 .xlam Microsoft Excel - Add-In File application/vnd.ms-excel.sheet.binary.macroenabled.12 .xlsb Microsoft Excel - Binary Workbook application/vnd.ms-excel.template.macroenabled.12 .xltm Microsoft Excel - Macro-Enabled Template File application/vnd.ms-excel.sheet.macroenabled.12 .xlsm Microsoft Excel - Macro-Enabled Workbook application/vnd.ms-htmlhelp .chm Microsoft Html Help File application/x-mscardfile .crd Microsoft Information Card application/vnd.ms-lrm .lrm Microsoft Learning Resource Module application/x-msmediaview .mvb Microsoft MediaView application/x-msmoney .mny Microsoft Money application/vnd.openxmlformats-officedocument.presentationml.presentation .pptx Microsoft Office - OOXML - Presentation application/vnd.openxmlformats-officedocument.presentationml.slide .sldx Microsoft Office - OOXML - Presentation (Slide) application/vnd.openxmlformats-officedocument.presentationml.slideshow .ppsx Microsoft Office - OOXML - Presentation (Slideshow) application/vnd.openxmlformats-officedocument.presentationml.template .potx Microsoft Office - OOXML - Presentation Template application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xlsx Microsoft Office - OOXML - Spreadsheet application/vnd.openxmlformats-officedocument.spreadsheetml.template .xltx Microsoft Office - OOXML - Spreadsheet Template application/vnd.openxmlformats-officedocument.wordprocessingml.document .docx Microsoft Office - OOXML - Word Document application/vnd.openxmlformats-officedocument.wordprocessingml.template .dotx Microsoft Office - OOXML - Word Document Template application/x-msbinder .obd Microsoft Office Binder application/vnd.ms-officetheme .thmx Microsoft Office System Release Theme application/onenote .onetoc Microsoft OneNote audio/vnd.ms-playready.media.pya .pya Microsoft PlayReady Ecosystem video/vnd.ms-playready.media.pyv .pyv Microsoft PlayReady Ecosystem Video application/vnd.ms-powerpoint .ppt Microsoft PowerPoint application/vnd.ms-powerpoint.addin.macroenabled.12 .ppam Microsoft PowerPoint - Add-in file application/vnd.ms-powerpoint.slide.macroenabled.12 .sldm Microsoft PowerPoint - Macro-Enabled Open XML Slide application/vnd.ms-powerpoint.presentation.macroenabled.12 .pptm Microsoft PowerPoint - Macro-Enabled Presentation File application/vnd.ms-powerpoint.slideshow.macroenabled.12 .ppsm Microsoft PowerPoint - Macro-Enabled Slide Show File application/vnd.ms-powerpoint.template.macroenabled.12 .potm Microsoft PowerPoint - Macro-Enabled Template File application/vnd.ms-project .mpp Microsoft Project application/x-mspublisher .pub Microsoft Publisher application/x-msschedule .scd Microsoft Schedule+ application/x-silverlight-app .xap Microsoft Silverlight application/vnd.ms-pki.stl .stl Microsoft Trust UI Provider - Certificate Trust Link application/vnd.ms-pki.seccat .cat Microsoft Trust UI Provider - Security Catalog application/vnd.visio .vsd Microsoft Visio application/vnd.visio2013 .vsdx Microsoft Visio 2013 video/x-ms-wm .wm Microsoft Windows Media audio/x-ms-wma .wma Microsoft Windows Media Audio audio/x-ms-wax .wax Microsoft Windows Media Audio Redirector video/x-ms-wmx .wmx Microsoft Windows Media Audio/Video Playlist application/x-ms-wmd .wmd Microsoft Windows Media Player Download Package application/vnd.ms-wpl .wpl Microsoft Windows Media Player Playlist application/x-ms-wmz .wmz Microsoft Windows Media Player Skin Package video/x-ms-wmv .wmv Microsoft Windows Media Video video/x-ms-wvx .wvx Microsoft Windows Media Video Playlist application/x-msmetafile .wmf Microsoft Windows Metafile application/x-msterminal .trm Microsoft Windows Terminal Services application/msword .doc Microsoft Word application/vnd.ms-word.document.macroenabled.12 .docm Microsoft Word - Macro-Enabled Document application/vnd.ms-word.template.macroenabled.12 .dotm Microsoft Word - Macro-Enabled Template application/x-mswrite .wri Microsoft Wordpad application/vnd.ms-works .wps Microsoft Works application/x-ms-xbap .xbap Microsoft XAML Browser Application application/vnd.ms-xpsdocument .xps Microsoft XML Paper Specification audio/midi .mid MIDI - Musical Instrument Digital Interface application/vnd.ibm.minipay .mpy MiniPay application/vnd.ibm.modcap .afp MO:DCA-P application/vnd.jcp.javame.midlet-rms .rms Mobile Information Device Profile application/vnd.tmobile-livetv .tmo MobileTV application/x-mobipocket-ebook .prc Mobipocket application/vnd.mobius.mbk .mbk Mobius Management Systems - Basket file application/vnd.mobius.dis .dis Mobius Management Systems - Distribution Database application/vnd.mobius.plc .plc Mobius Management Systems - Policy Definition Language File application/vnd.mobius.mqy .mqy Mobius Management Systems - Query File application/vnd.mobius.msl .msl Mobius Management Systems - Script Language application/vnd.mobius.txf .txf Mobius Management Systems - Topic Index File application/vnd.mobius.daf .daf Mobius Management Systems - UniversalArchive text/vnd.fly .fly mod_fly / fly.cgi application/vnd.mophun.certificate .mpc Mophun Certificate application/vnd.mophun.application .mpn Mophun VM video/mj2 .mj2 Motion JPEG 2000 audio/mpeg .mpga MPEG Audio video/vnd.mpegurl .mxu MPEG Url video/mpeg .mpeg MPEG Video application/mp21 .m21 MPEG-21 audio/mp4 .mp4a MPEG-4 Audio video/mp4 .mp4 MPEG-4 Video application/mp4 .mp4 MPEG4 application/vnd.apple.mpegurl .m3u8 Multimedia Playlist Unicode application/vnd.musician .mus MUsical Score Interpreted Code Invented for the ASCII designation of Notation application/vnd.muvee.style .msty Muvee Automatic Video Editing application/xv+xml .mxml MXML application/vnd.nokia.n-gage.data .ngdat N-Gage Game Data application/vnd.nokia.n-gage.symbian.install .n-gage N-Gage Game Installer application/x-dtbncx+xml .ncx Navigation Control file for XML (for ePub) application/x-netcdf .nc Network Common Data Form (NetCDF) application/vnd.neurolanguage.nlu .nlu neuroLanguage application/vnd.dna .dna New Moon Liftoff/DNA application/vnd.noblenet-directory .nnd NobleNet Directory application/vnd.noblenet-sealer .nns NobleNet Sealer application/vnd.noblenet-web .nnw NobleNet Web application/vnd.nokia.radio-preset .rpst Nokia Radio Application - Preset application/vnd.nokia.radio-presets .rpss Nokia Radio Application - Preset text/n3 .n3 Notation3 application/vnd.novadigm.edm .edm Novadigm's RADIA and EDM products application/vnd.novadigm.edx .edx Novadigm's RADIA and EDM products application/vnd.novadigm.ext .ext Novadigm's RADIA and EDM products application/vnd.flographit .gph NpGraphIt audio/vnd.nuera.ecelp4800 .ecelp4800 Nuera ECELP 4800 audio/vnd.nuera.ecelp7470 .ecelp7470 Nuera ECELP 7470 audio/vnd.nuera.ecelp9600 .ecelp9600 Nuera ECELP 9600 application/oda .oda Office Document Architecture application/ogg .ogx Ogg audio/ogg .oga Ogg Audio video/ogg .ogv Ogg Video application/vnd.oma.dd2+xml .dd2 OMA Download Agents application/vnd.oasis.opendocument.text-web .oth Open Document Text Web application/oebps-package+xml .opf Open eBook Publication Structure application/vnd.intu.qbo .qbo Open Financial Exchange application/vnd.openofficeorg.extension .oxt Open Office Extension application/vnd.yamaha.openscoreformat .osf Open Score Format audio/webm .weba Open Web Media Project - Audio video/webm .webm Open Web Media Project - Video application/vnd.oasis.opendocument.chart .odc OpenDocument Chart application/vnd.oasis.opendocument.chart-template .otc OpenDocument Chart Template application/vnd.oasis.opendocument.database .odb OpenDocument Database application/vnd.oasis.opendocument.formula .odf OpenDocument Formula application/vnd.oasis.opendocument.formula-template .odft OpenDocument Formula Template application/vnd.oasis.opendocument.graphics .odg OpenDocument Graphics application/vnd.oasis.opendocument.graphics-template .otg OpenDocument Graphics Template application/vnd.oasis.opendocument.image .odi OpenDocument Image application/vnd.oasis.opendocument.image-template .oti OpenDocument Image Template application/vnd.oasis.opendocument.presentation .odp OpenDocument Presentation application/vnd.oasis.opendocument.presentation-template .otp OpenDocument Presentation Template application/vnd.oasis.opendocument.spreadsheet .ods OpenDocument Spreadsheet application/vnd.oasis.opendocument.spreadsheet-template .ots OpenDocument Spreadsheet Template application/vnd.oasis.opendocument.text .odt OpenDocument Text application/vnd.oasis.opendocument.text-master .odm OpenDocument Text Master application/vnd.oasis.opendocument.text-template .ott OpenDocument Text Template image/ktx .ktx OpenGL Textures (KTX) application/vnd.sun.xml.calc .sxc OpenOffice - Calc (Spreadsheet) application/vnd.sun.xml.calc.template .stc OpenOffice - Calc Template (Spreadsheet) application/vnd.sun.xml.draw .sxd OpenOffice - Draw (Graphics) application/vnd.sun.xml.draw.template .std OpenOffice - Draw Template (Graphics) application/vnd.sun.xml.impress .sxi OpenOffice - Impress (Presentation) application/vnd.sun.xml.impress.template .sti OpenOffice - Impress Template (Presentation) application/vnd.sun.xml.math .sxm OpenOffice - Math (Formula) application/vnd.sun.xml.writer .sxw OpenOffice - Writer (Text - HTML) application/vnd.sun.xml.writer.global .sxg OpenOffice - Writer (Text - HTML) application/vnd.sun.xml.writer.template .stw OpenOffice - Writer Template (Text - HTML) application/x-font-otf .otf OpenType Font File application/vnd.yamaha.openscoreformat.osfpvg+xml .osfpvg OSFPVG application/vnd.osgi.dp .dp OSGi Deployment Package application/vnd.palm .pdb PalmOS Data text/x-pascal .p Pascal Source File application/vnd.pawaafile .paw PawaaFILE application/vnd.hp-pclxl .pclxl PCL 6 Enhanced (Formely PCL XL) application/vnd.picsel .efif Pcsel eFIF File image/x-pcx .pcx PCX Image image/vnd.adobe.photoshop .psd Photoshop Document application/pics-rules .prf PICSRules image/x-pict .pic PICT Image application/x-chat .chat pIRCh application/pkcs10 .p10 PKCS #10 - Certification Request Standard application/x-pkcs12 .p12 PKCS #12 - Personal Information Exchange Syntax Standard application/pkcs7-mime .p7m PKCS #7 - Cryptographic Message Syntax Standard application/pkcs7-signature .p7s PKCS #7 - Cryptographic Message Syntax Standard application/x-pkcs7-certreqresp .p7r PKCS #7 - Cryptographic Message Syntax Standard (Certificate Request Response) application/x-pkcs7-certificates .p7b PKCS #7 - Cryptographic Message Syntax Standard (Certificates) application/pkcs8 .p8 PKCS #8 - Private-Key Information Syntax Standard application/vnd.pocketlearn .plf PocketLearn Viewers image/x-portable-anymap .pnm Portable Anymap Image image/x-portable-bitmap .pbm Portable Bitmap Format application/x-font-pcf .pcf Portable Compiled Format application/font-tdpfr .pfr Portable Font Resource application/x-chess-pgn .pgn Portable Game Notation (Chess Games) image/x-portable-graymap .pgm Portable Graymap Format image/png .png Portable Network Graphics (PNG) image/x-citrix-png .png Portable Network Graphics (PNG) (Citrix client) image/x-png .png Portable Network Graphics (PNG) (x-token) image/x-portable-pixmap .ppm Portable Pixmap Format application/pskc+xml .pskcxml Portable Symmetric Key Container application/vnd.ctc-posml .pml PosML application/postscript .ai PostScript application/x-font-type1 .pfa PostScript Fonts application/vnd.powerbuilder6 .pbd PowerBuilder application/pgp-encrypted .pgp Pretty Good Privacy application/pgp-signature .pgp Pretty Good Privacy - Signature application/vnd.previewsystems.box .box Preview Systems ZipLock/VBox application/vnd.pvi.ptid1 .ptid Princeton Video Image application/pls+xml .pls Pronunciation Lexicon Specification application/vnd.pg.format .str Proprietary P&G Standard Reporting System application/vnd.pg.osasli .ei6 Proprietary P&G Standard Reporting System text/prs.lines.tag .dsc PRS Lines Tag application/x-font-linux-psf .psf PSF Fonts application/vnd.publishare-delta-tree .qps PubliShare Objects application/vnd.pmi.widget .wg Qualcomm's Plaza Mobile Internet application/vnd.quark.quarkxpress .qxd QuarkXpress application/vnd.epson.esf .esf QUASS Stream Player application/vnd.epson.msf .msf QUASS Stream Player application/vnd.epson.ssf .ssf QUASS Stream Player application/vnd.epson.quickanime .qam QuickAnime Player application/vnd.intu.qfx .qfx Quicken video/quicktime .qt Quicktime Video application/x-rar-compressed .rar RAR Archive audio/x-pn-realaudio .ram Real Audio Sound audio/x-pn-realaudio-plugin .rmp Real Audio Sound application/rsd+xml .rsd Really Simple Discovery application/vnd.rn-realmedia .rm RealMedia application/vnd.realvnc.bed .bed RealVNC application/vnd.recordare.musicxml .mxl Recordare Applications application/vnd.recordare.musicxml+xml .musicxml Recordare Applications application/relax-ng-compact-syntax .rnc Relax NG Compact Syntax application/vnd.data-vision.rdz .rdz RemoteDocs R-Viewer application/rdf+xml .rdf Resource Description Framework application/vnd.cloanto.rp9 .rp9 RetroPlatform Player application/vnd.jisp .jisp RhymBox application/rtf .rtf Rich Text Format text/richtext .rtx Rich Text Format (RTF) application/vnd.route66.link66+xml .link66 ROUTE 66 Location Based Services application/rss+xml .rss, .xml RSS - Really Simple Syndication application/shf+xml .shf S Hexdump Format application/vnd.sailingtracker.track .st SailingTracker image/svg+xml .svg Scalable Vector Graphics (SVG) application/vnd.sus-calendar .sus ScheduleUs application/sru+xml .sru Search/Retrieve via URL Response Format application/set-payment-initiation .setpay Secure Electronic Transaction - Payment application/set-registration-initiation .setreg Secure Electronic Transaction - Registration application/vnd.sema .sema Secured eMail application/vnd.semd .semd Secured eMail application/vnd.semf .semf Secured eMail application/vnd.seemail .see SeeMail application/x-font-snf .snf Server Normal Format application/scvp-vp-request .spq Server-Based Certificate Validation Protocol - Validation Policies - Request application/scvp-vp-response .spp Server-Based Certificate Validation Protocol - Validation Policies - Response application/scvp-cv-request .scq Server-Based Certificate Validation Protocol - Validation Request application/scvp-cv-response .scs Server-Based Certificate Validation Protocol - Validation Response application/sdp .sdp Session Description Protocol text/x-setext .etx Setext video/x-sgi-movie .movie SGI Movie application/vnd.shana.informed.formdata .ifm Shana Informed Filler application/vnd.shana.informed.formtemplate .itp Shana Informed Filler application/vnd.shana.informed.interchange .iif Shana Informed Filler application/vnd.shana.informed.package .ipk Shana Informed Filler application/thraud+xml .tfi Sharing Transaction Fraud Data application/x-shar .shar Shell Archive image/x-rgb .rgb Silicon Graphics RGB Bitmap application/vnd.epson.salt .slt SimpleAnimeLite Player application/vnd.accpac.simply.aso .aso Simply Accounting application/vnd.accpac.simply.imp .imp Simply Accounting - Data Import application/vnd.simtech-mindmapper .twd SimTech MindMapper application/vnd.commonspace .csp Sixth Floor Media - CommonSpace application/vnd.yamaha.smaf-audio .saf SMAF Audio application/vnd.smaf .mmf SMAF File application/vnd.yamaha.smaf-phrase .spf SMAF Phrase application/vnd.smart.teacher .teacher SMART Technologies Apps application/vnd.svd .svd SourceView Document application/sparql-query .rq SPARQL - Query application/sparql-results+xml .srx SPARQL - Results application/srgs .gram Speech Recognition Grammar Specification application/srgs+xml .grxml Speech Recognition Grammar Specification - XML application/ssml+xml .ssml Speech Synthesis Markup Language application/vnd.koan .skp SSEYO Koan Play File text/sgml .sgml Standard Generalized Markup Language (SGML) application/vnd.stardivision.calc .sdc StarOffice - Calc application/vnd.stardivision.draw .sda StarOffice - Draw application/vnd.stardivision.impress .sdd StarOffice - Impress application/vnd.stardivision.math .smf StarOffice - Math application/vnd.stardivision.writer .sdw StarOffice - Writer application/vnd.stardivision.writer-global .sgl StarOffice - Writer (Global) application/vnd.stepmania.stepchart .sm StepMania application/x-stuffit .sit Stuffit Archive application/x-stuffitx .sitx Stuffit Archive application/vnd.solent.sdkm+xml .sdkm SudokuMagic application/vnd.olpc-sugar .xo Sugar Linux Application Bundle audio/basic .au Sun Audio - Au file format application/vnd.wqd .wqd SundaHus WQ application/vnd.symbian.install .sis Symbian Install Package application/smil+xml .smi Synchronized Multimedia Integration Language application/vnd.syncml+xml .xsm SyncML application/vnd.syncml.dm+wbxml .bdm SyncML - Device Management application/vnd.syncml.dm+xml .xdm SyncML - Device Management application/x-sv4cpio .sv4cpio System V Release 4 CPIO Archive application/x-sv4crc .sv4crc System V Release 4 CPIO Checksum Data application/sbml+xml .sbml Systems Biology Markup Language text/tab-separated-values .tsv Tab Seperated Values image/tiff .tiff Tagged Image File Format application/vnd.tao.intent-module-archive .tao Tao Intent application/x-tar .tar Tar File (Tape Archive) application/x-tcl .tcl Tcl Script application/x-tex .tex TeX application/x-tex-tfm .tfm TeX Font Metric application/tei+xml .tei Text Encoding and Interchange text/plain .txt Text File application/vnd.spotfire.dxp .dxp TIBCO Spotfire application/vnd.spotfire.sfs .sfs TIBCO Spotfire application/timestamped-data .tsd Time Stamped Data Envelope application/vnd.trid.tpt .tpt TRI Systems Config application/vnd.triscape.mxs .mxs Triscape Map Explorer text/troff .t troff application/vnd.trueapp .tra True BASIC application/x-font-ttf .ttf TrueType Font text/turtle .ttl Turtle (Terse RDF Triple Language) application/vnd.umajin .umj UMAJIN application/vnd.uoml+xml .uoml Unique Object Markup Language application/vnd.unity .unityweb Unity 3d application/vnd.ufdl .ufd Universal Forms Description Language text/uri-list .uri URI Resolution Services application/vnd.uiq.theme .utz User Interface Quartz - Theme (Symbian) application/x-ustar .ustar Ustar (Uniform Standard Tape Archive) text/x-uuencode .uu UUEncode text/x-vcalendar .vcs vCalendar text/x-vcard .vcf vCard application/x-cdlink .vcd Video CD application/vnd.vsf .vsf Viewport+ model/vrml .wrl Virtual Reality Modeling Language application/vnd.vcx .vcx VirtualCatalog model/vnd.mts .mts Virtue MTS model/vnd.vtu .vtu Virtue VTU application/vnd.visionary .vis Visionary video/vnd.vivo .viv Vivo application/ccxml+xml, .ccxml Voice Browser Call Control application/voicexml+xml .vxml VoiceXML application/x-wais-source .src WAIS Source application/vnd.wap.wbxml .wbxml WAP Binary XML (WBXML) image/vnd.wap.wbmp .wbmp WAP Bitamp (WBMP) audio/x-wav .wav Waveform Audio File Format (WAV) application/davmount+xml .davmount Web Distributed Authoring and Versioning application/x-font-woff .woff Web Open Font Format application/wspolicy+xml .wspolicy Web Services Policy image/webp .webp WebP Image application/vnd.webturbo .wtb WebTurbo application/widget .wgt Widget Packaging and XML Configuration application/winhlp .hlp WinHelp text/vnd.wap.wml .wml Wireless Markup Language (WML) text/vnd.wap.wmlscript .wmls Wireless Markup Language Script (WMLScript) application/vnd.wap.wmlscriptc .wmlsc WMLScript application/vnd.wordperfect .wpd Wordperfect application/vnd.wt.stf .stf Worldtalk application/wsdl+xml .wsdl WSDL - Web Services Description Language image/x-xbitmap .xbm X BitMap image/x-xpixmap .xpm X PixMap image/x-xwindowdump .xwd X Window Dump application/x-x509-ca-cert .der X.509 Certificate application/x-xfig .fig Xfig application/xhtml+xml .xhtml XHTML - The Extensible HyperText Markup Language application/xml .xml XML - Extensible Markup Language application/xcap-diff+xml .xdf XML Configuration Access Protocol - XCAP Diff application/xenc+xml .xenc XML Encryption Syntax and Processing application/patch-ops-error+xml .xer XML Patch Framework application/resource-lists+xml .rl XML Resource Lists application/rls-services+xml .rs XML Resource Lists application/resource-lists-diff+xml .rld XML Resource Lists Diff application/xslt+xml .xslt XML Transformations application/xop+xml .xop XML-Binary Optimized Packaging application/x-xpinstall .xpi XPInstall - Mozilla application/xspf+xml .xspf XSPF - XML Shareable Playlist Format application/vnd.mozilla.xul+xml .xul XUL - XML User Interface Language chemical/x-xyz .xyz XYZ File Format text/yaml .yaml YAML Ain't Markup Language / Yet Another Markup Language application/yang .yang YANG Data Modeling Language application/yin+xml .yin YIN (YANG - XML) application/vnd.zul .zir Z.U.L. Geometry application/zip .zip Zip Archive application/vnd.handheld-entertainment+xml .zmm ZVUE Media Manager application/vnd.zzazz.deck+xml .zaz Zzazz Deck `; // Reset `lastIndex` if this regex is defined globally // regex.lastIndex = 0; let m; while ((m = regex.exec(str)) !== null) { // This is necessary to avoid infinite loops with zero-width matches if (m.index === regex.lastIndex) { regex.lastIndex++; } // The result can be accessed through the `m`-variable. m.forEach((match, groupIndex) => { console.log(`Found match, group ${groupIndex}: ${match}`); }); }

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions