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
  • 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 = '/(?=[\r\n]+)\s*([0-9]+[\/][^\r\n\s])+\s*[0-9][^\r\n]*[\r\n]+/'; $str = 'WIRES Wire Details Actions: Go Print Close Rec\'d Date/Time (EST) Sender ST Wire Type/Title Master Message # Deal Type RE: $ 437,025,000 CITY OF AURORA, COLORADO ACTING BY AND THROUGH ITS UTILITY ENTERPRISE FIRST LIEN WATER REFUNDING BONDS, SERIES 2016 (GREEN BONDS) LADIES AND GENTLEMEN: WE HAVE RECEIVED THE WRITTEN AWARD. TODAY, JULY 22ND WILL BE INITIAL TRADE DATE. TIME OF FIRST EXECUTION IS 11:00AM EST. MOODY\'S: NR S&P: AA+ FITCH: AA+ DATED:08/16/2016 FIRST COUPON:02/01/2017 DUE: 08/01 INITIAL TRADE DATE: 07/22/2016 @ 11:00AM Eastern MATURITY AMOUNT COUPON PRICE CUSIP 08/01/2020 2,350M 1.50% 0.83 051595AL0 (Approx. $ Price 102.603) 08/01/2021 4,855M 5.00% 0.97 051595AM8 (Approx. $ Price 119.462) 08/01/2022 7,565M 5.00% 1.13 051595AN6 (Approx. $ Price 122.238) 08/01/2023 10,410M 5.00% 1.28 051595AP1 (Approx. $ Price 124.689) 08/01/2024 1,625M 3.00% 1.40 051595AQ9 (Approx. $ Price 112.009) 08/01/2024 9,305M 5.00% 1.40 051595BE5 (Approx. $ Price 127.021) 08/01/2025 11,445M 5.00% 1.52 051595AR7 (Approx. $ Price 129.042) 08/01/2026 4,000M 4.00% 1.65 051595AS5 (Approx. $ Price 121.498) 08/01/2026 8,015M 5.00% 1.65 051595BJ4 (Approx. $ Price 130.646) 08/01/2027 12,015M 5.00% 1.76 051595AT3 (Approx. $ Price PTC 08/01/2026 129.476 Approx. YTM 1.992) 08/01/2028 12,615M 5.00% 1.87 051595BF2 (Approx. $ Price PTC 08/01/2026 128.318 Approx. YTM 2.281) 08/01/2029 13,245M 5.00% 1.93 051595AU0 (Approx. $ Price PTC 08/01/2026 127.691 Approx. YTM 2.487) 08/01/2030 13,905M 5.00% 1.98 051595BG0 (Approx. $ Price PTC 08/01/2026 127.172 Approx. YTM 2.657) 08/01/2031 14,600M 5.00% 2.03 051595AV8 (Approx. $ Price PTC 08/01/2026 126.655 Approx. YTM 2.806) 08/01/2032 6,045M 4.00% 2.33 051595AW6 (Approx. $ Price PTC 08/01/2026 114.764 Approx. YTM 2.843) 08/01/2032 8,835M 5.00% 2.08 051595BM7 (Approx. $ Price PTC 08/01/2026 126.141 Approx. YTM 2.936) 08/01/2033 15,565M 5.00% 2.13 051595AX4 (Approx. $ Price PTC 08/01/2026 125.629 Approx. YTM 3.053) 08/01/2034 16,345M 5.00% 2.18 051595AY2 (Approx. $ Price PTC 08/01/2026 125.119 Approx. YTM 3.157) 08/01/2035 17,160M 5.00% 2.22 051595AZ9 (Approx. $ Price PTC 08/01/2026 124.714 Approx. YTM 3.244) 08/01/2036 18,020M 5.00% 2.26 051595BA3 (Approx. $ Price PTC 08/01/2026 124.310 Approx. YTM 3.324) 08/01/2041 40,000M 3.00% 2.90 051595BK1 (Approx. $ Price PTC 08/01/2026 100.858 Approx. YTM 2.951) 08/01/2041 62,915M 5.00% 2.32 051595BD7 (Approx. $ Price PTC 08/01/2026 123.706 Approx. YTM 3.559) 08/01/2046 45,000M 2.00% 100.00 051595BB1 **STEP COUPON 08/01/2046 25,000M 3.00% 2.95 051595BL9 (Approx. $ Price PTC 08/01/2026 100.427 Approx. YTM 2.978) 08/01/2046 5,000M 4.00% 2.62 051595BH8 (Approx. $ Price PTC 08/01/2026 112.026 Approx. YTM 3.360) 08/01/2046 51,190M 5.00% 2.37 051595BC9 (Approx. $ Price PTC 08/01/2026 123.206 Approx. YTM 3.710) --------------------------------------- CALL FEATURES: Optional call in 08/01/2026 @ 100.00 EXCEPT: 08/01/2046 Optional call in 08/01/2019 @ 100.00 Coupon: 2.000 **THE STEP COUPON BONDS WILL BEAR INTEREST EACH PERIOD AS FOLLOWS: FROM TO (AND INCLUDING) INTEREST RATE --------- ------------------ ------------- 08/16/2016 07/31/2019 2.000% 08/01/2019 07/31/2026 2.250% 08/01/2026 07/31/2031 3.500% 08/01/2031 07/31/2041 4.500% 08/01/2041 08/01/2046 5.000% --------------------------------------- Sinking Fund Schedule 2041 Term Bond 08/01/2037 7,535M 08/01/2038 7,760M 08/01/2039 7,995M 08/01/2040 8,230M 08/01/2041 8,480M Sinking Fund Schedule 2041 Term Bond 08/01/2037 11,385M 08/01/2038 11,955M 08/01/2039 12,550M 08/01/2040 13,185M 08/01/2041 13,840M Sinking Fund Schedule 2046 Term Bond 08/01/2042 8,145M 08/01/2043 8,550M 08/01/2044 8,980M 08/01/2045 9,425M 08/01/2046 9,900M Sinking Fund Schedule 2046 Term Bond 08/01/2042 4,710M 08/01/2043 4,850M 08/01/2044 4,995M 08/01/2045 5,145M 08/01/2046 5,300M Sinking Fund Schedule 2046 Term Bond 08/01/2042 920M 08/01/2043 960M 08/01/2044 1,000M 08/01/2045 1,040M 08/01/2046 1,080M Sinking Fund Schedule 2046 Term Bond 08/01/2042 9,265M 08/01/2043 9,730M 08/01/2044 10,210M 08/01/2045 10,725M 08/01/2046 11,260M PRIORITY OF ORDERS: 1. Net Designated (Except if an investor is affiliated with a syndicate member in which case the economics will be reallocated among the other managers. Please contact the Senior Manager.) 2. Individual Colorado Retail 3. Individual National Retail 4. Member "Individual Colorado Retail Order" is defined as an order up to $1,000,000 placed on behalf of an individual in Colorado. Larger Individual Colorado Retail Orders will be accepted at the sole discretion of the City. All Individual Colorado Retail Orders must include account numbers and zip codes. An "Individual National Retail Order" is defined as an order up to $1,000,000 placed on behalf of an individual outside of Colorado. Larger Individual National Retail Orders will be accepted at the sole discretion of the City. All Individual National Retail Orders must include account numbers and zip codes. Priority Policy: Morgan Stanley & Co. must receive 50% of each designation. RBC Capital Markets must receive at least 20% of each designation. Bank of America Merrill Lynch and Wells Fargo Securities must each be designated at least 10%. No firm may receive more than 50% of each designation. The compliance addendum MSRB Rule G-11 will apply. The Award is expected on Thursday, July 21, 2016 at 5:10PM Eastern . Delivery is firm for Tuesday, August 16, 2016. This issue is book entry only. This issue is clearing through DTC. Award: 07/21/2016 Award Time: 5:10PM Eastern Delivery: 08/16/2016 (Firm) Initial trade: 07/22/2016 Date of Execution: 07/22/2016 Time of Execution: 11:00AM Eastern Electronic copies of the Preliminary Official Statement can be accessed via the following link: http://www.meritos.com/cgi-bin/disclaimer.pl?Did=2225 Morgan Stanley & Co. LLC RBC Capital Markets Bank of America Merrill Lynch Wells Fargo Securities (trade name for Wells Fargo Bank N.A. Municipal Products Group) By: Morgan Stanley & Co. LLC New York, NY Close Terms and Conditions of Use and Privacy Statement © 2016 Ipreo. All rights reserved. '; 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