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

/
/
gm

Test String

Code Generator

Generated Code

#include <StringConstants.au3> ; to declare the Constants of StringRegExp #include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate Local $sRegex = "(?m)(?s)your\s*capital\s*contribution\s*is\s*due\s*on\s*or\s*before\s*(.*?20[1-9][0-9])\s*\.?\s*" Local $sString = ""cash - 0k" & @CRLF & _ "p-ok" & @CRLF & _ "VIOLA wires - 0k" & @CRLF & _ "VENTURES" & @CRLF & _ "unfunded 253,585 - 0k" & @CRLF & _ "March 5, 2020" & @CRLF & _ "To: PAPEF VII-B, L.P." & @CRLF & _ "Re: Viola Ventures IV - 41st Capital Call" & @CRLF & _ "We are pleased to announce the 41st capital call of Viola Ventures IV (""the Fund""). The Fund expects" & @CRLF & _ "to use this capital contribution to fund follow-on investments in Codefresh Inc. (""Codefresh"") and" & @CRLF & _ "Seebo Ltd. (""Seebo"")." & @CRLF & _ "The Capital Call proceeds will be applied as follows:" & @CRLF & _ "Use of Contribution Amount ($)" & @CRLF & _ "Investment in Codefresh 1,941,145" & @CRLF & _ "Investment in Seebo 600,000" & @CRLF & _ "Use of reserves (71,494)" & @CRLF & _ "Total 2,469,651" & @CRLF & _ "Pursuant to section 3.2 of the Amended and Restated Limited Partnership Agreements of the Fund," & @CRLF & _ "notice is hereby given that your capital contribution is due on or before March 19, 2020. The" & @CRLF & _ "contribution to be made by you is $45,161 and is equal to 1.3% of your subscription to the Fund." & @CRLF & _ "This contribution reflects a recallable amount, previously distributed." & @CRLF & _ "To date, your share in the recallable distributions made by the Fund equals to $317,093." & @CRLF & _ "Your aggregate contribution out of such recallable distributions, including this capital call, IS" & @CRLF & _ "$184,533." & @CRLF & _ "Following this capital call, your remaining recallable amount out of such recallable distributions" & @CRLF & _ "already made by the fund is $132,560." & @CRLF & _ "Funds, in U.S. dollars, should be wired in accordance with the attached instructions." & @CRLF & _ "Please have your bank identify the name of the Limited Partner for which the contribution is being" & @CRLF & _ "made. It is important to show the name of the Limited Partner exactly as shown on the subscription" & @CRLF & _ "agreement so that we can identify the sender." & @CRLF & _ "In the event that you receive a notice or any capital call instructing you to forward the funds to" & @CRLF & _ "another bank account which is not the existing account of the Fund as detailed in the attached" & @CRLF & _ "instructions, please do not transfer the funds and contact us immediately via telephone at +972-9-" & @CRLF & _ "9720400." & @CRLF & _ "Should you have any questions, please do not hesitate to contact our Partner & CFO, Itzik Avidor," & @CRLF & _ "iavidor@viola.vc or our Controller, Mor Bar morl@viola-group.com." & @CRLF & _ "Sincerely yours," & @CRLF & _ "Viola Ventures 4 L.P." & @CRLF & _ "By Viola Ventures 4 Ltd., its general partner" & @CRLF & _ "12 Abba Eban Avenue, Bldg. D, Herzeliya, Israel / 09-9720400 / viola.vc" & @CRLF & _ "" & @CRLF & _ "VIOLA" & @CRLF & _ "VENTURES" & @CRLF & _ "Wire Instructions for Capital Contribution" & @CRLF & _ "Bank: Silicon Valley Bank" & @CRLF & _ "Bank Address: 3003 Tasman Drive, Santa Clara, CA 95054" & @CRLF & _ "Account number: 3302648406" & @CRLF & _ "Account name: Viola Ventures IV (A), L.P." & @CRLF & _ "ABA Routing: 121140399" & @CRLF & _ "Swift code: SVBl<US6S" & @CRLF & _ "Sender: PAPEF VII-B, L.P." & @CRLF & _ "Amount: 45,161 USD" & @CRLF & _ "Reference: 41st Capital Call" & @CRLF & _ "Unless you are contacted by us via telephone and receive our verbal confirmation to any change in" & @CRLF & _ "the bank account details, you are kindly requested to keep transferring any capital call payments to" & @CRLF & _ "the above mentioned bank account of the Fund. The Fund shall not be responsible for any transfer" & @CRLF & _ "of capital call payments to other bank accounts." & @CRLF & _ "12 Abba Eban Avenue, Bldg. D, Herzeliya, Israel / 09-9720400 / viola.vc" & @CRLF & _ "" & @CRLF & _ "VIOLA" & @CRLF & _ "VENTURES" & @CRLF & _ "March 5, 2020" & @CRLF & _ "To: PAPEF VII (Offshore)-B, L.P." & @CRLF & _ "Re: Viola Ventures IV - 41st Capital Call" & @CRLF & _ "We are pleased to announce the 41st capital call of Viola Ventures IV (""the Fund""). The Fund expects" & @CRLF & _ "to use this capital contribution to fund follow-on investments in Codefresh Inc. (""Codefresh"") and" & @CRLF & _ "Seebo Ltd. (""Seebo"")." & @CRLF & _ "The Capital Call proceeds will be applied as follows:" & @CRLF & _ "Use of Contribution Amount ($)" & @CRLF & _ "Investment in Codefresh 1,941,145" & @CRLF & _ "Investment in Seebo 600,000" & @CRLF & _ "Use of reserves (71,494)" & @CRLF & _ "Total 2,469,651" & @CRLF & _ "Pursuant to section 3.2 of the Amended and Restated Limited Partnership Agreements of the Fund," & @CRLF & _ "notice is hereby given that your capital contribution is due on or before March 19, 2020. The" & @CRLF & _ "contribution to be made by you is $19,938 and is equal to 1.3% of your subscription to the Fund." & @CRLF & _ "This contribution reflects a recallable amount, previously distributed." & @CRLF & _ "To date, your share in the recallable distributions made by the Fund equals to $139,994." & @CRLF & _ "Your aggregate contribution out of such recallable distributions, including this capital call, IS" & @CRLF & _ "$81,470." & @CRLF & _ "Following this capital call, your remaining recallable amount out of such recallable distributions" & @CRLF & _ "already made by the fund is $58,524." & @CRLF & _ "Funds, in U.S. dollars, should be wired in accordance with the attached instructions." & @CRLF & _ "Please have your bank identify the name of the Limited Partner for which the contribution is being" & @CRLF & _ "made. It is important to show the name of the Limited Partner exactly as shown on the subscription" & @CRLF & _ "agreement so that we can identify the sender." & @CRLF & _ "In the event that you receive a notice or any capital call instructing you to forward the funds to" & @CRLF & _ "another bank account which is not the existing account of the Fund as detailed in the attached" & @CRLF & _ "instructions, please do not transfer the funds and contact us immediately via telephone at +972-9-" & @CRLF & _ "9720400." & @CRLF & _ "Should you have any questions, please do not hesitate to contact our Partner & CFO, Itzik Avidor," & @CRLF & _ "iavidor@viola.vc or our Controller, Mor Bar morl@viola-group.com." & @CRLF & _ "Sincerely yours," & @CRLF & _ "Viola Ventures 4 L.P." & @CRLF & _ "By Viola Ventures 4 Ltd., its general partner" & @CRLF & _ "12 Abba Eban Avenue, Bldg. D, Herzeliya, Israel / 09-9720400 / viola.vc" & @CRLF & _ "" & @CRLF & _ "VIOLA" & @CRLF & _ "VENTURES" & @CRLF & _ "Wire Instructions for Capital Contribution" & @CRLF & _ "Bank: Silicon Valley Bank" & @CRLF & _ "Bank Address: 3003 Tasman Drive, Santa Clara, CA 95054" & @CRLF & _ "Account number: 3302648406" & @CRLF & _ "Account name: Viola Ventures IV (A), L.P." & @CRLF & _ "ABA Routing: 121140399" & @CRLF & _ "Swift code: SVBl<US6S" & @CRLF & _ "Sender: PAPEF (Offshore)-B, L.P." & @CRLF & _ "Amount: 19,938 USD" & @CRLF & _ "Reference: 41st Capital Call" & @CRLF & _ "Unless you are contacted by us via telephone and receive our verbal confirmation to any change in" & @CRLF & _ "the bank account details, you are kindly requested to keep transferring any capital call payments to" & @CRLF & _ "the above mentioned bank account of the Fund. The Fund shall not be responsible for any transfer" & @CRLF & _ "of capital call payments to other bank accounts." & @CRLF & _ "12 Abba Eban Avenue, Bldg. D, Herzeliya, Israel / 09-9720400 / viola.vc" & @CRLF & _ "" & @CRLF & _ "Chelsea McGowan" & @CRLF & _ "From: Mor Bar <Morl@viola-group.com>" & @CRLF & _ "Sent: Thursday, March 12, 2020 11:39 AM" & @CRLF & _ "To: Chelsea McGowan; ViolaVentures Investor Communication" & @CRLF & _ "Cc: papefvii@portad.com" & @CRLF & _ "Subject: RE: Viola Ventures IV - 41st Capital Call" & @CRLF & _ "Hi Chelsea," & @CRLF & _ "See below:" & @CRLF & _ "PAPEF VII-B, LP - Unfunded commitment - $43,358 and the remaining recallable amount is $132,560." & @CRLF & _ "PAPEF VII(Offshore)-B, LP - Unfunded commitment - $19,142 and the remaining recallable amount is $58,524." & @CRLF & _ "Hope it helps," & @CRLF & _ "Mor" & @CRLF & _ "Mor Bar T +97299720413" & @CRLF & _ "Controller M +972 50 8430844" & @CRLF & _ "Viola morl@viola-group.com" & @CRLF & _ "www.viola-group.com" & @CRLF & _ "From: Chelsea McGowan <cmcgowan@alterdomus.us>" & @CRLF & _ "Sent: Tuesday, March 10, 2020 3:51 PM" & @CRLF & _ "To: ViolaVentures Investor Communication <ViolaVenturesInvestor@viola.vc>" & @CRLF & _ "Cc: papefvii@portad.com" & @CRLF & _ "Subject: RE: Viola Ventures IV - 41st Capital Call" & @CRLF & _ "Good morning," & @CRLF & _ "Can you please confirm the unfunded commitments for PAPEF VII-B, LP and PAPEF VII(Offshore)-B, LP as of the date of" & @CRLF & _ "the attached notice?" & @CRLF & _ "Thank you," & @CRLF & _ "CHELSEA MCGOWAN, MSA" & @CRLF & _ "Fund Accountant, US" & @CRLF & _ "9 Old Kings Highway South" & @CRLF & _ "Darien, CT 06820" & @CRLF & _ "Direct: +1 (203) 309-4193" & @CRLF & _ "www.alterDomus.com" & @CRLF & _ "WE'RE WHERE YOU NEED US" & @CRLF & _ "Australia - Belgium - Cayman Islands - China - Cyprus - France - Germany - Guernsey - Hong Kong - Ireland - Jersey - Luxembourg - Malta - Mauritius - Singapore -" & @CRLF & _ "The Netherlands - United Kingdom - USA" & @CRLF & _ "1" & @CRLF & _ "" & @CRLF & _ "Alter Domus Email policy." & @CRLF & _ "Please consider the environment before printing." & @CRLF & _ "From: ViolaVentures Investor Communication <ViolaVenturesInvestor@viola.vc>" & @CRLF & _ "Sent: Thursday, March 5, 2020 10:04 AM" & @CRLF & _ "To: Mike T Forward 2019 <mtrinkaus@alterdomus.us>" & @CRLF & _ "Cc: papefvii@portad.com" & @CRLF & _ "Subject: Viola Ventures IV - 41st Capital Call" & @CRLF & _ "Dear Investor," & @CRLF & _ "PAPEF VII-B, L.P." & @CRLF & _ "Please find attached the 41st Capital Call of Viola Ventures IV." & @CRLF & _ "Best regards," & @CRLF & _ "Viola Ventures" & @CRLF & _ "*NOTICE: This communication is intended only for the use of the individual or entity to which it is addressed and may" & @CRLF & _ "contain confidential and/or legally privileged material. Any forwarding, copying, disclosure, distribution, or other use of" & @CRLF & _ "this information by any person is prohibited. If the reader of this communication is not the intended recipient or his or" & @CRLF & _ "her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this" & @CRLF & _ "communication is strictly prohibited. If you have received this communication in error, please notify sender immediately" & @CRLF & _ "by replying to this message and deleting it from your account." & @CRLF & _ "2"" Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH) Local $aFullArray[0] For $i = 0 To UBound($aArray) -1 _ArrayConcatenate($aFullArray, $aArray[$i]) Next $aArray = $aFullArray ; Present the entire match result _ArrayDisplay($aArray, "Result")

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 AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm