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

/
/
gm

Test String

Code Generator

Generated Code

const regex = /[A-Z].*(?=\s[A-Z]{1}\d{7}[A-Z]{1})/gm; // Alternative syntax using RegExp constructor // const regex = new RegExp('[A-Z].*(?=\\s[A-Z]{1}\\d{7}[A-Z]{1})', 'gm') const str = `1-------------------------------------------------------------------------------------------------- ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of DELOITTE CONSULTING/ICS PTE. LTD. (199702256Z) Date: 23/09/2020 The Following Are The Brief Particulars of : Registration No. : 55626262536Z Company Name. : DEDEDEDE CONSULTING/ICS PTE. LTD. (w.e.f.30/05/2003) Former Name if any : BARXIT HOLDING PTE. LTD. Incorporation Date. : 05/04/1997 Company Type : PRIVATE COMPANY LIMITED BY SHARES Status : Live Company Status Date : 05/04/1997 Principal Activities Activities (I) : INFORMATION TECHNOLOGY CONSULTANCY (EXCEPT CYBERSECURITY) (62021) Description : IMPLEMENTATION OF SOFTWARE SOLUTIONS & PROVISIONS OF ANCILLARY SERVICES Activities (II) : Description : Capital Issued Share Capital Number of Shares * Currency Share Type (AMOUNT) 25 25 SINGAPORE, DOLLARS ORDINARY 41234121 100000 SINGAPORE, DOLLARS PREFERENCE Number of Shares includes number of Treasury Shares Paid-Up Capital Number of Shares Currency Share Type (AMOUNT) 25 SINGAPORE, DOLLARS ORDINARY 1243124 SINGAPORE, DOLLARS PREFERENCE Authentication No. : A43124141G Page 1 of 4ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of DELOITTE CONSULTING/ICS PTE. LTD. (199702256Z) Date: 23/09/2020 COMPANY HAS THE FOLLOWING ORDINARY SHARES HELD AS TREASURY SHARES Number Of Shares Currency Registered Office Address : 6 SHELDON WAY #33-44 OUE DOWNTOWN SINGAPORE (1234112) Date of Address : 11/03/2015 Date of Last AGM : 26/11/2019 Date of Last AR : 02/12/2019 FYE As At Date of Last AR : 31/05/2018 Audit Firms NAME AUDIT CHUCHU LLP Charges Charge No. Date Registered Currency Amount Secured Chargee(s) Officers/Authorised Representative(s) Name ID Nationality/Citizenship Source of Date of Appointment Address Address Position Held RAMON CHITO JR FABIAN RAMOS S7587099Z FILIPINO ACRA 20/11/2017 11A HAUSTA ST CAPITOL PARK GOHNOWE Director POLAOAS CITY, CHINA 1126 MITSUBISHU SRINIVASA KASANUA S124121125H SINGAPORE CITIZEN OSCARS 01/06/2011 MURALIDHAR 28 KAKI BUAKIS STREET 52 Director #03-044 GUILIN VIEW SINGAPORE (141212) AOLAOS GEORGE HUATAH ABRAHAM A41234112 MALAYSIAN ACRA 20/11/2017 Authentication No. : A43124141G Page 2 of 4ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of DELOITTE CONSULTING/ICS PTE. LTD. (199702256Z) Date: 23/09/2020 Officers/Authorised Representative(s) Name ID Nationality/Citizenship Source of Date of Appointment Address Address Position Held 15C-14-04 15A MOUTANIN KALALSA PINES, JLN 512/70C, Director MONT BINATU OFF JLN BUKIT KAKATSU, 50480 KUALA BEARSLA, MALAYSIA HO HOHO SENG ABRAHAME S1234121D SINGAPORE CITIZEN ACRA 01/08/2014 9 BUKIT HOKATO CENTRAL LINK Director #236-04 THE CRYTALJADE SINGAPORE (14234123) YET YET KIAT S1324112D MALAYSIAN OSCARS 30/04/2018 676A JURONG GOHOMELA STREET 64 Secretary #15-4251 HOTSWHICH@GOHOME SINGAPORE (123412) HO HOHO SENG ABRAHAME S1234121D SINGAPORE CITIZEN ACRA 01/06/2017 9 BUKIT HOKATO CENTRAL LINK Director #236-04 THE CRYTALJADE SINGAPORE (14234123) Shareholder(s) Name ID Nationality/Citizenship Source of Address Changed Place of incorporation/ Address Address Origin/Registration 1 YEETOKAOSK CONSULTING PTE. LTD. 1324123411N SINGAPORE ACRA 6 SHELDON WAY #13-45 OUE UPTOWNFUNKY SINGAPORE (1324121) Ordinary(Number) Currency 52 SINGAPORE, DOLLARS Preference(Number) Currency 13412311 SINGAPORE, DOLLARS Authentication No. : A43124141G Page 3 of 4ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of GOHOMECLUB CONSULTING/ICS PTE. LTD. (134142112Z) Date: 23/09/2020 Abbreviation UL - Local Entity not registered with ACRA UF - Foreign Entity not registered with ACRA AR - Annual Return AGM - Annual General Meeting FS - Financial Statements FYE - Financial Year End OSCARS - One Stop Change of Address Reporting Service by Immigration & Checkpoint Authority. Note : The information contained in this product is collated from lodgements filed with ACRA, and/or information collected by other government sources. The list of officers for this entity is available for online authentication within 30 days from the date of purchase of this Business Profile. Please scan the QR code available on the last page of this profile to access the authentication page. For more information, please visit www.acra.gov.sg. FOR REGISTRAR OF COMPANIES AND BUSINESS NAMES SINGAPORE RECEIPT NO. : ACRA4123412412 DATE : 23/09/2020 This is computer generated. Hence no signature required. Authentication No. : A412341411G Page 4 of 4 2------------------------------------------------------------------------------------------------- ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of WHAT INTHEWO PTE. LTD. (123456674M) Date: 19/02/2020 The Following Are The Brief Particulars of : Registration No. : 123456674M Company Name. : WHAT INTHEWO PTE. LTD. Former Name if any : Incorporation Date. : 10/01/2017 Company Type : HELVATE COMPANY LIMITED BY SHARES Status : Dead Company Status Date : 10/01/2017 Principal Activities Activities (I) : INFORMATION TECHNOLOGY CONSULTANCY (EXCEPT HELPRSECURITY) (61231) Description : SOFTWARE CONSULTING, SOFTWARE APPLICATION DEVELOPMENT Activities (II) : Description : Capital Issued Share Capital Number of Shares * Currency Share Type (AMOUNT) 25321 9999 TAIWANESE, DOLLARS ORDINARY Number of Shares includes number of Treasury Shares Paid-Up Capital Number of Shares Currency Share Type (AMOUNT) 25321 TAIWANESE, DOLLARS ORDINARY COMPANY HAS THE FOLLOWING ORDINARY SHARES HELD AS TREASURY SHARES Number Of Shares Currency Authentication No. : L12001832Z Page 1 of 4ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of WHAT INTHEWO PTE. LTD. (123456674M) Date: 19/02/2020 Registered Office Address : 4 SHELDON WAY #01-02 GPS CENTRE II TAIWAN (43212) Date of Address : 10/01/2017 Date of Last AGM : 03/02/2020 Date of Last AR : 18/02/2020 FYE As At Date of Last AR : 31/12/2018 Audit Firms NAME LKKK LLP Charges Charge No. Date Registered Currency Amount Secured Chargee(s) Officers/Authorised Representative(s) Name ID Nationality Source of Date of Appointment Address Address Position Held RAUL ANBULLY PAKURDAD S3451233E TAIWANESE CITIZEN OSCARS 25/11/2017 @RAMADAN 36 TURF CLUB ROAD Director SINGAPORE (287978) SAMBABABIN HENTHAL MUDYR S3123442E INDIAN ACRA 18/07/2019 80 JOLLYHELI ROAD Director #06-11 CITYLIGHTS TAIWAN (141532) TAKHALA SAI PANGSAI F4123451Q INDIAN ACRA 10/01/2017 36 STURDY ROAD Director #01-53 RIVERDALE TAIWAN (754352) TAKHALA SAI PANGSAI F4123451Q INDIAN ACRA 10/01/2017 Authentication No. : L12001832Z Page 2 of 4ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of WHAT INTHEWO PTE. LTD. (123456674M) Date: 19/02/2020 Officers/Authorised Representative(s) Name ID Nationality Source of Date of Appointment Address Address Position Held 36 STURDY ROAD Secretary #01-53 RIVERDALE TAIWAN (754352) Shareholder(s) Name ID Nationality/Place of Source of Address Changed incorporation/Origin Address Address 1 HELLS TECHNOLOGIES PTE. LTD. 1234161241H TAIWANESE ACRA 4 SHELDON WAY #12-03 GPS CENTRE II TAIWAN (068807) Ordinary(Number) Currency 9999 TAIWAN, DOLLARS Abbreviation UL - Local Entity not registered with ACRA UF - Foreign Entity not registered with ACRA AR - Annual Return AGM - Annual General Meeting FS - Financial Statements FYE - Financial Year End OSCARS - One Stop Change of Address Reporting Service by Immigration & Checkpoint Authority. Note : The information contained in this Business Profile is extracted from lodgements filed by this entity with ACRA. Authentication No. : L12001832Z Page 3 of 4ACCOUNTING AND CORPORATE REGULATORY AUTHORITY (ACRA) WHILST EVERY ENDEAVOR IS MADE TO ENSURE THAT INFORMATION PROVIDED IS UPDATED AND CORRECT. THE AUTHORITY DISCLAIMS ANY LIABILITY FOR ANY DAMAGE OR LOSS THAT MAY BE CAUSED AS A RESULT OF ANY ERROR OR OMISSION. Business Profile (Company) of WHAT INTHEWO PTE. LTD. (123456674M) Date: 19/02/2020 The list of officers for this entity is available for online authentication within 30 days from the date of purchase of this Business Profile. Please scan the QR code available on the last page of this profile to access the authentication page. For more information, please visit www.acra.gov.sg. FOR REGISTRAR OF COMPANIES AND BUSINESS NAMES SINGAPORE RECEIPT NO. : ACRA12344534544124 (Free Business Profile by ACRA) DATE : 19/02/2020 This is computer generated. Hence no signature required. Authentication No. : L12001832Z Page 4 of 4`; // 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