Regular Expressions 101

Save & Share

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
  • Match everything enclosed
    (?:...)
  • Capture everything enclosed
    (...)
  • 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

r"
"
gmi

Test String

Code Generator

Generated Code

const regex = new RegExp('^(?P<protocol>[\\w]+)\\:\\/\\/(?P<host>[\\w\\.\\-]+)(\\:(?P<port>\\d+))?((?P<path>\\/[^\\?\\#\\n]*)(\\?(?P<params>(?P<first_param>[^\\#\\?\\&\\=\\n]+(=[^\\#\\?\\&\\=\\n]*)*)(\\&(?P<param_more>[^\\#\\?\\&\\=\\n]+(=[^\\#\\?\\&\\=\\n]*)*))*))?(\\#(?P<tag>[^\\#\\?\\n]+)?)?)?$', 'gmi') const str = `HTTP://www.empower54.org Http://the-woods.org/cv.pdf ftp://200.37.254.51/pub/METI%20Space%20Policy.pdf ftp://dossier.ogp.noaa.gov/GCOS/WMO-Normals/RA-II/OM/41256.TXT ftp://eclipse.ncdc.noaa.gov/pub/ibtracs/original-bt-data-files/nadi/RSMC%20Nadi%20BT%20Data%202007_8.txt ftp://ftp.atdd.noaa.gov/pub/GCOS/WMO-Normals/TABLES/REGIII/PY/86255.TXT ftp://ftp.atdd.noaa.gov/pub/GCOS/WMO-Normals/TABLES/REG_VI/PO/08515.TXT ftp://ftp.atdd.noaa.gov/pub/GCOS/WMO-Normals/TABLES/REG__I/M1/61291.TXT ftp://ftp.atdd.noaa.gov/pub/GCOS/WMO-Normals/TABLES/REG__V/MS/48665.TXT ftp://ftp.cordis.europa.eu/pub/fp7/ict/docs/ict-wp-2007-08_en.pdf ftp://ftp.dot.state.pa.us/public/Bureaus/BOMO/RM/RITS/Annual%20Electronic%20SLDs%20by%20County/District%209/Fulton%20Co.%20No%20Pipes.pdf ftp://ftp.dot.state.pa.us/public/pdf/BPR_PDF_FILES/MAPS/Type_10_GHS_Historical_Scans/Chester_1959_Sheet_1.pdf ftp://ftp.dot.state.pa.us/public/pdf/BPR_PDF_FILES/MAPS/Type_10_GHS_Historical_Scans/Delaware_1996.pdf ftp://ftp.ebi.ac.uk/pub/databases/chebi/ ftp://ftp.fao.org/docrep/fao/009/x8750e/x8750e02.pdf ftp://ftp.fao.org/docrep/fao/010/a1250e/annexes/List%20of%20breeds%20documented%20in%20the%20Global%20Databank%20for%20Animal%20Genetic%20Resources/List_breeds.pdf ftp://ftp.fcc.gov/pub/Daily_Releases/Daily_Business/2011/db0608/DOC-307173A2.txt ftp://ftp.gps.caltech.edu/pub/avouac/OwensValley/Lienkaemperetal1987.pdf ftp://ftp.inf.ethz.ch/pub/crypto/publications/Maurer92b.ps ftp://ftp.math.ucla.edu/pub/camreport/cam04-71.pdf ftp://ftp.met.fsu.edu/pub/weather/tropical/Atl-Dis/2007053111.AXNT20 ftp://ftp.met.fsu.edu/pub/weather/tropical/GuamStuff/2008051709-WTPN.PGTW ftp://ftp.met.fsu.edu/pub/weather/tropical/GuamStuff/2009061815-WDPN.PGTW ftp://ftp.met.fsu.edu/pub/weather/tropical/GuamStuff/2009090106-ABPW.PGTW ftp://ftp.met.fsu.edu/pub/weather/tropical/GuamStuff/2010031016-ABPW.PGTW ftp://ftp.met.fsu.edu/pub/weather/tropical/Outlook-A/2001/Aug/2001083109.ABNT20 ftp://ftp.met.fsu.edu/pub/weather/tropical/Outlook-P/2004/Jul/2004072522.ABPZ20 ftp://ftp.met.fsu.edu/pub/weather/tropical/Pac-Dis/2008052603.AXPZ20 ftp://ftp.nada.kth.se/CVAP/reports/cvap159.pdf ftp://ftp.ncdc.noaa.gov/pub/data/normals/1981-2010/products/station/USC00305840.normals.txt ftp://ftp.ncdc.noaa.gov/pub/data/normals/1981-2010/products/station/USW00025339.normals.txt ftp://ftp.sam.math.ethz.ch/pub/sam-reports/reports/reports2010/2010-38.pdf ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/FAQ ftp://ftp.software.ibm.com/software/globalization/locales/France-French_Date.pdf ftp://ftp.software.ibm.com/software/globalization/locales/Nicaragua-Spanish_Date.pdf ftp://ftp.uni-potsdam.de/pub/WWW/clients/netscape/plugins/ifc/1.0/ ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/ITDWeb/sat_plan_est.pdf ftp://iecc.com/pub/file/bliss.tar.gz ftp://rock.geosociety.org/pub/Memorials/v05/Duncan-HM.pdf ftp://rock.geosociety.org/pub/Memorials/v29/nafe.pdf ftp://tug.org/historic/systems/texlive/2003/live.pdf ftp://tug.org/historic/systems/texlive/2006/ ftp://www.istorichka.ru/Periodika/Voprosy_Jazykoznanija/1976/1976_1.pdf git://git.savannah.gnu.org/gnash.git http://.go.com/mlb/stats/parkfactor http://0-content.ebscohost.com.helin.uri.edu/pdf19_22/pdf/2007/YQR/11Apr07/24963097.pdf?T=P&P=AN&K=24963097&S=R&D=a9h&EbscoContent=dGJyMNLr40SeprE4v%2BbwOLCmr0qepq5Srqi4TLSWxWXS&ContentCustomer=dGJyMPGvrki0ra9JuePfgeyx44Dt6fIA http://0-muse.jhu.edu.dewey2.library.denison.edu/article/12611 http://0-search.credoreference.com.dewey2.library.denison.edu/content/entry/abcafatrle/latin_american_literature/0?institutionId=4607 http://0-wwd.com.library.scad.edu/business-news/sourcing-global-markets/japan-fashion-week-fall-2016-10388614-10388614/ http://0100101110101101.org/rot/ http://059822.net/news/FS3.html http://1.bp.blogspot.com/-3pHlcUMnsyk/UgwjckLXs0I/AAAAAAAAYHQ/DkyiYAwWm8M/s1600/_ben.jpg http://10.1353/par.0.0047* http://10.asiae.co.kr/Articles/new_view.htm?a_id=2012013017592766335 http://10.asiae.co.kr/Articles/new_view.htm?sec=ent3&a_id=2011032113184258354 http://10.asiae.co.kr/Articles/new_view.htm?tsc=002005000&a_id=2009111708281332116&pg= http://100.empas.com/dicsearch/pentry.html?s=B&i=171078 http://100.empas.com/dicsearch/pentry.html?s=B&i=209985&v=47 http://100.empas.com/dicsearch/pentry.html?s=K&i=300001&v=44 http://100.naver.com/100.nhn?docid=4790 http://100.naver.com/100.nhn?docid=872348 http://100.naver.com/100.nhn?docid=91049 http://1000aircraftphotos.com/Contributions/HornDavid/9335.htm http://1000years.uazone.net/pub/Jukivka.doc http://100anosgalo.blogspot.com/2009/12/guerino-minervino-neto.html http://100years.akleg.gov/bio.php?id=717 http://103.241.136.49/130124/entertainment-mollywood/article/celebrating-red-wine http://1033ampradio.radio.com http://1057thezone.iheart.com http://1066.co.nz/library/battle_abbey_roll2/battle_abbey_roll2.txt http://1067thebull.iheart.com/ http://10kbullets.com/reviews/erotic-nights-of-the-living-dead http://10news.com./news/24382836/detail.html http://112.international/business-and-policy/Odesa-to-become-a-world-center-of-entertainment-Saakashvili-965.html http://1150wima.iheart.com http://11syyskuu.net/video/terror.wmv http://12.151.120.44/explore/studiolo/studiolo_hmpg.html http://123.63.242.116/pallavapuram/abt-muni.htm http://123telugu.com/slideshow/movies/Y/Yeto_Vellipoyindhi_Manasu_Track_List/1.html http://128.121.186.47/ISSA/reports/Balkan/Sep1903.htm http://12or20questions.blogspot.com/2007/09/12-or-20-questions-with-joshua-marie.html http://134.60.85.50:591/Earwig_online/FMPro?-db=distribution.fp5&-format=continents_erg.html&-lay=standard&-sortField=CountryRef&-sortorder=ascend&GenusEpithetonRef=Aborolabis%20pervicina&-find= http://140.247.119.138/OS_Homepage/ http://142.176.62.102/scripts/esrimap.dll?name=nsplacenames&cmd=4&zoomcons=1&action=zoomToPlace&objid=24006&prov=false http://147.231.53.91/src/index.php?s=v&cat=3&bookid=68&page=351 http://1476.orf.at http://14threunion.blogspot.com/2011/03/corps-of-signals-first-indian-signal.html http://150.254.171.193/ipac20/ipac.jsp?session=1E73DH1187659.747638&profile=bgpp&page=2&group=0&term=Rachunek+prawdopodobie%C5%84stwa+--+zadania+i+%C4%87wiczenia.&index=SW&uindex=&aspect=subtab14&menu=search&ri=1&source=~!bpp&1273951188119#focus http://152.111.1.87/argief/berigte/dieburger/1989/03/31/15/14.html http://152.111.1.87/argief/berigte/dieburger/2013/04/26/KS/23/oosVarsityspan.html http://152.111.1.88/argief/berigte/beeld/1993/12/14/4/14.html http://152.111.1.88/argief/berigte/beeld/2011/04/04/B1/2/polpdt3003.html http://155.83.192.50/wcscripts/pertdataNew.pl http://160.92.130.81/IMG/File/patnat/sites/60-55.pdf http://163.1.169.40/cgi-bin/library?e=d-000-00---0POxy--00-0-0--0prompt-10---4------0-1l--1-en-50---20-about---00031-001-1-0utfZz-8-00&a=d&c=POxy&cl=CL5.1.1&d=HASH018aae267b75be8320f99ba9 http://163.1.169.40/cgi-bin/library?e=d-000-00---0POxy--00-0-0--0prompt-10---4----ded--0-1l--1-en-50---20-about-1708--00031-001-1-0utfZz-8-00&a=d&c=POxy&cl=CL5.1.2&d=HASH66d3681e4cf514d692ae08 http://163.1.169.40/cgi-bin/library?e=d-000-00---0POxy--00-0-0--0prompt-10---4----ded--0-1l--1-en-50---20-about-P%2eOxy%2eI+0100--00031-001-1-0utfZz-8-00&a=d&c=POxy&cl=CL5.1.1&d=HASH018aae267b75be5ae0f99ba9 http://163.1.169.40/cgi-bin/library?e=d-000-00---0POxy--00-0-0--0prompt-10---4----ded--0-1l--1-en-50---20-about-P.Oxy.I+0100--00031-001-1-0utfZz-8-00&a=d&c=POxy&cl=CL5.1.1&d=HASH018aae267b75be4b20f99ba9 http://150.254.171.193/ipac20/ipac.jsp?session=1E73DH1187659.747638&profile=bgpp&page=2&group=0&term=Rachunek+prawdopodobie%C5%84stwa+--+zadania+i+%C4%87wiczenia.&index=SW&uindex=&aspect=subtab14&menu=search&ri=1&source=~!bpp&1273951188119#focus http://3g.163.com/ent/article/BRUCO0V9000333J5.html#adaptation=pc&refer=https%3A%2F%2Fm.baidu.com%2Ffrom%3D844b%2Fbd_page_type%3D1%2Fssid%3D0%2Fuid%3D0%2Fpu%3Dusm%25401%252Csz%25401320_2001%252Cta%2540iphone_1_9.1_3_601%2Fbaiduid%3DD08A12FD0E6ED4EFAE527096C1342EA0%2Fw%3D10_10_%2Ft%3Diphone%2Fl%3D1%2Ftc%3Fref%3Dwww_iphone%26lid%3D2887819655476323459%26order%3D1%26fm%3Dalop%26waplogo%3D1%26tj%3Dwww_normal_1_10_10_title%26vit%3Dosres%26waput%3D3%26cltj%3Dnormal_title%26asres%3D1%26nt%3Dwnor%26title%3D%25E9%259D%2592%25E5%25B9%25B4%25E9%2592%25A2%25E7%2590%25B4%25E6%25BC%2594%25E5%25A5%258F%25E5%25AE%25B6%25E6%259D%258E%25E6%2598%2580%253A%25E7%2583%25AD%25E7%2588%25B1%25E4%25BA%258B%25E4%25B8%259A%25E9%259C%2580%25E8%25A6%2581%25E6%2597%25B6%25E9%2597%25B4%25E7%259A%2584%25E7%25A7%25AF%25E6%25B7%2580_%25E7%25BD%2591%25E6%2598%2593%25E5%25A8%25B1%25E4%25B9%2590%26dict%3D20%26w_qd%3DIlPT2AEptyoA_ykzsO9bswFsRjUZtZJ7%26sec%3D22401%26di%3D91ef50a72f8cce69%26bdenc%3D1%26tch%3D124.0.320.182.0.0%26nsrc%3DIlPT2AEptyoA_yixCFOxXnANedT62v3IIxiJ_85CQXSxokDyqRKuVhEsRG3cASvTUS3cdSPQpqtjpUPY05Af7RJ0ra6nmW96kzm9u_%26eqid%3D281398ad240ea4001000000659649feb%26wd%3D%26clk_info%3D%257B%2522srcid%2522%253A%25221599%2522%252C%2522tplname%2522%253A%2522www_normal%2522%252C%2522t%2522%253A1499766769111%252C%2522sig%2522%253A%25224968%2522%252C%2522xpath%2522%253A%2522div-a-h3%2522%257D http://4um.bjork.com/viewtopic.php?p=598416#598416 http://THSlone.tripod.com/MPEB.html#tokpisin http://aaronrasmussen.com/index/#/blindside/ http://aas.org/grants/awards.php#pierce http://abc.go.com/primetime/privatepractice/index?pn=bios#t=character&d=25006 http://abcnews.go.com/Politics/anti-abortion-activist-randall-terry-eyes-presidency-graphic/story?id=12639702#.UcxSXTvIEuc http://abcnews.go.com/US/grief-turn-loving-mom-sex-offender/story?id=14924854#.Tr5wnvKuGXs http://abcnews.go.com/US/yeardley-loves-mother-sues-convicted-uva-killer-george/story?id=16227560#.T-oiAZHw9kQ http://aberteke.walon.org/abertekes-engl.html#pweti-en http://access.bl.uk/item/viewer/lsidyv2e9f5636#ark:/81055/vdc_000000027695.0x00001C http://acharts.co/artist/cribs#albums http://actionspeaksradio.org/griswold-v-connecticut/#.UbZVV_mTgV0 http://adoption.state.gov/country/china.html#who1 http://advsys.net/ken/utils.htm#pngout http://afltables.com/afl/crowds/stkilda.html#02 http://afltables.com/afl/seas/1990.html#lad http://afltables.com/afl/seas/2012.html#23 http://afltables.com/afl/stats/2012.html#20 http://africanelections.tripod.com/ne.html#2004_Presidential_Election http://aftenbladet.no/skatt/?do=search&firstname=karen+anette&lastname=stai&age=&taxYear=&fylke=0&kommune=0# http://agoraclass.fltr.ucl.ac.be/concordances/intro.htm#ju http://akaddesign.com/fulio/gandom-cafe/?lang=en#toggle-id-4-closed http://aktuelt.fo/gudrid+hansdottir+givid+ut+flogu+vid+7+logum+i+dag.html#.UwxI20IhCK0 http://al-quran.info/#111:1 http://alumnus.caltech.edu/~ejohnson/critics/ebert.html#y1996 http://americanhistory.si.edu/JeffersonBible/the-book/?view=transcription&page=44#dl http://amiga.resource.cx/company/company.pl#phase5 http://animals.nationalgeographic.com/animals/fish/clown-anemonefish/# http://appointments.gc.ca/prflOrg.asp?OrgID=HSM&lang=eng#PersonID_22267 http://apps.webofknowledge.com/full_record.do?product=WOS&search_mode=GeneralSearch&qid=4&SID=4BgGUKx67aV9nKQYOk3&page=2&doc=13# http://apps.who.int/classifications/icd10/browse/2016/en#/E78.6 http://apps.who.int/classifications/icd10/browse/2016/en#/G0.2 http://apps.who.int/classifications/icd10/browse/2016/en#/G95.1 http://apps.who.int/classifications/icd10/browse/2016/en#/H35.7 http://apps.who.int/classifications/icd10/browse/2016/en#/I23.0 http://apps.who.int/classifications/icd10/browse/2016/en#/I70.9 http://apps.who.int/classifications/icd10/browse/2016/en#/J20.5 http://apps.who.int/classifications/icd10/browse/2016/en#/J47 http://apps.who.int/classifications/icd10/browse/2016/en#/K10.8 http://apps.who.int/classifications/icd10/browse/2016/en#/K31.5 http://apps.who.int/classifications/icd10/browse/2016/en#/M31 http://apps.who.int/classifications/icd10/browse/2016/en#/O21.1 http://apps.who.int/classifications/icd10/browse/2016/en#/Q15.8 http://apps.who.int/classifications/icd10/browse/2016/en#/Q79 http://apps.who.int/classifications/icd10/browse/2016/en#/R02 http://apps.who.int/classifications/icd10/browse/2016/en#/T46.0 http://apps.who.int/classifications/icd10/browse/2016/en#/T57.0 http://apps.who.int/classifications/icd10/browse/2016/en#/T59.5 http://apps.who.int/classifications/icd10/browse/2016/en#/T78.1 http://arabic.arabianbusiness.com/politics-economics/society/2009/oct/29/30433/#.VpLNOPn5jIU http://archaeologydataservice.ac.uk/archiveDS/archiveDownload?t=arch-281-1/dissemination/pdf/cba_rr_079.pdf#p=122 http://archive.adl.org/terror/tu/tu_0404_philippines.html#.VUgNa46qqko http://archive.aviationweek.com/issue/19720626/#!&pid=102 http://archive.li/z13H#selection-3155.183-3155.280 http://archives.newyorker.com/?i=1999-10-18#folio=172 http://archivio.corriere.it/Archivio/interface/view.shtml#!/NjovZXMvaXQvcmNzZGF0aWRhY3AxL0AyMjI1Mg%3D%3D http://archrecord.construction.com/designVanguard/DesignVanguardPast.asp#2003 http://artdaily.com/news/67296/-Clarice-Smith--Recollections-of-a-Life-in-Art--on-display-at-the-New-York-Historical-Society#.WNqT4qK1vIV http://au.encarta.msn.com/encyclopedia_761571330/Rutskoy_Aleksandr_Vladimirovich.html#461528998 http://austriancharts.at/weekchart.asp?cat=d&year=2006&date=20060217# http://austringer.net/wp/?p=626#more-626 http://ava.prri.org/#lgbt/2017/States/lgbt_ssm/m/US-SC http://az.lib.ru/c/chehow_a_p/text_0100.shtml#13 http://babel.hathitrust.org/cgi/pt?id=nyp.33433066590823#view=1up;seq=96 http://bahai-library.com/handscause_statistics_1953-63#89 http://bea.gov/national/nipaweb/TableView.asp?SelectedTable=1&ViewSeries=NO&Java=no&Request3Place=N&3Place=N&FromView=YES&Freq=Qtr&FirstYear=2009&LastYear=2010&3Place=N&Update=Update&JavaBox=no#Mid http://bellamysorganic.com.au/blog/why-are-there-7-different-logos-for-organic-certification-in-australia/#.VO5yLvmUfTo http://bemaniwiki.com/index.php?beatmania%20IIDX%2022%20PENDUAL#j5c56c66 http://bestsellery.zpav.pl/airplays/top/archiwum.php?year=2013&idlisty=864#title http://bestsellery.zpav.pl/airplays/top/archiwum.php?year=2017&idlisty=2259#title http://bie.ala.org.au/species/urn:lsid:biodiversity.org.au:apni.taxon:306345# http://bjorner.com/DSN07010%20-%201984%20Europe%20Tour.htm#DSN07120 http://bjorner.com/DSN07660%20-%201986%20Down%20Under%20Tour.htm#DSN07720 http://blackreelawards.wordpress.com/2012/12/19/black-reels-embraces-diverse-group-of-films/#more-1314 http://bleacherreport.com/articles/1223253-ufc-148-silva-vs-sonnen-ii-and-the-10-most-awaited-bouts-in-mma#/articles/1223253-ufc-148-silva-vs-sonnen-ii-and-the-10-most-awaited-bouts-in-mma/page/11 http://blog.chron.com/txpotomac/2013/07/filemon-vela-jr-explains-his-resignation-from-congressional-hispanic-caucus-says-immigration-foes-are-extracting-a-pound-of-flesh-as-price-of-reform/#13746101=0 http://blog.chron.com/ultimateastros/2014/08/01/astros-calling-up-mike-foltynewicz/#22102103=0&25575101=0 http://blog.sfgate.com/ontheblock/2016/12/10/in-the-wake-of-the-ghost-ship-fire-examining-oaklands-staggering-rent-hikes/#photo-781392 http://blog.sfgate.com/thebigevent/2011/12/22/todays-special-best-christmas-movies-of-all-time/#2224101=0 http://blogs.forward.com/the-arty-semite/148632/israeli-fashionistas-in-under--years/#ixzz2sMHpBnqO http://blogs.ft.com/beyond-brics/2012/04/24/sierra-leone-a-one-stock-shop/#axzz1yKETllWA http://blogs.indiewire.com/bent/14-films-you-must-watch-at-frameline-2014-20140617?page=2#blogPostHeaderPanel/ http://blogs.indiewire.com/theplaylist/the-amazing-spider-man-takes-another-page-from-the-dark-knight-marketing-playbook-with-viral-ad-starring-denis-leary# http://blogs.myspace.com/index.cfm?fuseaction=blog.view&friendId=411057&blogId=530989674#bio http://blogs.myspace.com/index.cfm?fuseaction=blog.view&friendId=8202636&blogId=538572306#ixzz0ymuETGLj http://blogs.sciencemag.org/pipeline/archives/2005/10/11/the_old_stuff#44460 http://blogs.usatoday.com/listenup/2008/09/this-weeks-re-4.html#more http://bloodstock.racingpost.com/dam/dam_home.sd?horse_id=4#damTabs=dam_progeny_sales http://bloodstock.racingpost.com/sales/results/individual_home.sd?tab=&st=8&l=&i=1&ob=ln&od=ASC&page=1&fv=131072&df=1993-11-29&dt=1993-12-02&venue_id=5&hn=Nicer&s=&a=&sin=&dn=&sdn=&vn=&b=&mip=&map=&lm=#individualResultsTabs=catalogue_5 http://bloodstock.racingpost.com/sales/results/individual_home.sd?tab=&st=8&l=&i=1&ob=ln&od=ASC&page=1&fv=131072&df=1996-07-15&dt=1996-07-16&venue_id=6&hn=&s=&a=&sin=&dn=population&sdn=&vn=&b=&mip=&map=&lm=#individualResultsTabs=catalogue_6 http://bloodstock.racingpost.com/sales/results/individual_home.sd?tab=&st=8&l=&i=1&ob=ln&od=ASC&page=1&fv=131072&df=2010-08-13&dt=2010-08-16&venue_id=36&hn=&s=&a=&sin=&dn=Sumora&sdn=&vn=&b=&mip=&map=&lm=#individualResultsTabs=catalogue_36 http://board.byuu.org/viewtopic.php?f=9&t=2465&start=360#p94340 http://boards.sportslogos.net/topic/93118-sports-graphics-packages-historically/page-4#entry2118163 http://bobpark.physics.umd.edu/WN99/wn010899.html#2 http://book.schooltool.org/htmlhelp/features.html#basic-use-cases`; // 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