Regular Expressions 101

Save & Share

  • Regex Version: ver. 4
  • 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

/
/
g

Test String

Code Generator

Generated Code

$re = '/(?i)<(?:(?!br>|br\/>)[^>\'"]*|([\'"]).*?\1)*>|(&nbsp;)|(amp;)|(:)/'; $str = '<p><strong>Relationship Executive:</strong> Ugeshnee Naraidu</p> <p><strong>Transactional Banker: </strong>Reshma Ramlal</p> <p><strong>Credit Analyst:</strong>&nbsp;Owen Denhere</p> <p><strong>TFL:</strong> R55.570m</p> <p>&nbsp;</p> <p><strong>DG</strong>: 15 ( Cloud 9 Trading&nbsp;(Pty) Ltd)</p> <p><strong>Request:</strong></p> <ul> <li>New R35,040,000 (USD 2,000,000) CFC Overdraft Facility ino Cloud 9 (Pty) Ltd ("C9"), supported by full cash cover from an Absa Investment.<br /> <ul> <li>Note that the R35,040,000 limit was arrived at after using the USD/ZAR import indication rate of 14.6000 as at 25/10/2018 and allowing a 20% margin to cater for movements in foreign exchange rates.</li> <li>Facility is to be 120% secured by pledge and cession of Absa Investment account (Still to be opened and funds tranferred)</li> </ul> </li> </ul> <p><strong>Background and Rationale</strong></p> <ul> <li>Cloud 9 Trading (Pty) Ltd is the importing arm (for the Group) of high fashion garments, sportswear and sport equipment and distribution to major clothing retail outlets (Miladys, Mr Price, Foschini, Exact, Truworths, Markhams, Total Sport, Queenspark) takes place through Fashion and Textile Sales (Pty) Ltd, Captotron CC and Blue Diamond SA CC.</li> <li>The Group operates from Riverhorse Industrial Park from properties owned by Winsport Trading Enterprises (Property owning entity).</li> <li>The group has a well-developed and efficient logistics, warehousing and distribution network. They have established a branch office in China so that they will be able to deal directly with the factories in the Far East.</li> <li>Client has a R20,000,000 FEC facility with Absa. Client does not currently want to buy options and prefers to wait fro rand to be trading at better rates before proceeding with importation.</li> <li>The CFC Overdrfat facility will ollow our client to have better control over the volatility in exchange rates, as he will be able to make payments for imports when it suits him.</li> </ul> <p><strong>Previous Conditions of Grant.</strong></p> <p>The following conditions of grant were put in place with application a replacement of security application approved recently on 23 Ocober 2018 (Webica 293038). We note the existence of these conditions and stress that they are still to be fulfilled:</p> <ul> <li>Client and Auditor to fully explain in writing why Absa facilities and security ino C9 is not reflected on the Annual Financial Statements for 2018 of C9. Signed Annual Financial Statements to be obtained reflecting the facilities and securities granted by Absa in this name. This is required before the change in security.</li> <li>Commercial Property Finance account number 7010122693 to be fully paid up and facility cancelled on the system before release of security.</li> <li>Cession of fire policy for replacement value per the valuation over Section No. 603 more fully described on Sectional Plan No. SS 409/2008 in the scheme known as KYLEMORE in respect of the land and building to be taken.</li> <li>Limited guarantee of R20,000,000 by RED DAFFODIL INVESTMENTS (PTY) LTD ifo C9 to be released after six months of perfection of new security offered.</li> <li>Solvency certificate to be obtained for Laritza Investments No 33 (Pty) Ltd.</li> <li>Confirmation that rates and taxes on Section No. 603 more fully described on Sectional Plan No. SS 409/2008 in the scheme known as KYLEMORE in respect of the land and building or buildings situated at Cape Town are paid up to date.</li> <li>Nedbank to cancel the bond held over the property, Section No. 603 more fully described on Sectional Plan No. SS 409/2008 in the scheme known as KYLEMORE in respect of the land and building or buildings situated at Cape Town.</li> <li>Confirmation from Nedbank that any facilities relating to the property, Section No. 603 more fully described on Sectional Plan No. SS 409/2008 in the scheme known as KYLEMORE in respect of the land and building or buildings situated at Cape Town are fully paid off and the account(s) closed.</li> </ul> <p>&nbsp;</p> <p><strong>General:</strong></p> <ul> <li><strong>Covenant breaches:</strong> N/A</li> <li><strong>3 1 (f):</strong> N/A</li> <li><strong>GCIS:</strong>&nbsp;Not Applicable</li> <li><strong>EWL and ARMS classifications:</strong> N/A</li> <li><strong>Exposure policy:</strong> Maintain</li> <li><strong>Risk hold:</strong> High risk hold</li> <li><strong>CPA:</strong> N/A</li> <li><strong>NCA:</strong> Out</li> <li><strong>CIPC:</strong> In business as per inquiry dated 19/07/2018</li> <li><strong>ITC:</strong> Clear as per inquiry dated 19/07/2018 and 20/07/2018</li> <li><strong>KI:</strong> Clear as per inquiry dated 20/07/2018</li> </ul>'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches);

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 PHP, please visit: http://php.net/manual/en/ref.pcre.php