Regular Expressions 101

Save & Share

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

/
/

Test String

Substitution

Processing...

Code Generator

Generated Code

#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox Local $sRegex = "\/\*(.|\n|\r)*\*\/" Local $sString = "" & @CRLF & _ "package es.elcorteingles.ns.integrations.schema.omnistoreordernotification._2_0;" & @CRLF & _ "" & @CRLF & _ "import javax.xml.bind.annotation.XmlAccessType;" & @CRLF & _ "import javax.xml.bind.annotation.XmlAccessorType;" & @CRLF & _ "import javax.xml.bind.annotation.XmlType;" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "/**" & @CRLF & _ " * Contiene informacion del coste a nivel de" & @CRLF & _ " * ShippingGroup." & @CRLF & _ " * - Importe total." & @CRLF & _ " * - Importe pendiente a cobrar." & @CRLF & _ " * - Importe" & @CRLF & _ " * del gasto de envío" & @CRLF & _ " * " & @CRLF & _ " * " & @CRLF & _ " * <p>Java class for ShippingGroupPriceInfoType complex type." & @CRLF & _ " * " & @CRLF & _ " * <p>The following schema fragment specifies the expected content contained within this class." & @CRLF & _ " * " & @CRLF & _ " * <pre>" & @CRLF & _ " * &lt;complexType name="ShippingGroupPriceInfoType">" & @CRLF & _ " * &lt;complexContent>" & @CRLF & _ " * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">" & @CRLF & _ " * &lt;sequence>" & @CRLF & _ " * &lt;element name="totalCost" type="{http://www.elcorteingles.es/ns/integrations/schema/OmniStoreOrderNotification/2_0}AmountType" minOccurs="0"/>" & @CRLF & _ " * &lt;element name="pendingCost" type="{http://www.elcorteingles.es/ns/integrations/schema/OmniStoreOrderNotification/2_0}AmountType" minOccurs="0"/>" & @CRLF & _ " * &lt;element name="shippingCost" type="{http://www.elcorteingles.es/ns/integrations/schema/OmniStoreOrderNotification/2_0}AmountType" minOccurs="0"/>" & @CRLF & _ " * &lt;element name="groupDiscountsAmount" type="{http://www.elcorteingles.es/ns/integrations/schema/OmniStoreOrderNotification/2_0}AmountType" minOccurs="0"/>" & @CRLF & _ " * &lt;element name="totalNetAmount" type="{http://www.elcorteingles.es/ns/integrations/schema/OmniStoreOrderNotification/2_0}AmountType" minOccurs="0"/>" & @CRLF & _ " * &lt;/sequence>" & @CRLF & _ " * &lt;/restriction>" & @CRLF & _ " * &lt;/complexContent>" & @CRLF & _ " * &lt;/complexType>" & @CRLF & _ " * </pre>" & @CRLF & _ " * " & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ "@XmlAccessorType(XmlAccessType.FIELD)" & @CRLF & _ "@XmlType(name = "ShippingGroupPriceInfoType", propOrder = {" & @CRLF & _ " "totalCost"," & @CRLF & _ " "pendingCost"," & @CRLF & _ " "shippingCost"," & @CRLF & _ " "groupDiscountsAmount"," & @CRLF & _ " "totalNetAmount"" & @CRLF & _ "})" & @CRLF & _ "public class ShippingGroupPriceInfoType {" & @CRLF & _ "" & @CRLF & _ " protected AmountType totalCost;" & @CRLF & _ " protected AmountType pendingCost;" & @CRLF & _ " protected AmountType shippingCost;" & @CRLF & _ " protected AmountType groupDiscountsAmount;" & @CRLF & _ " protected AmountType totalNetAmount;" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Gets the value of the totalCost property." & @CRLF & _ " * " & @CRLF & _ " * @return" & @CRLF & _ " * possible object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public AmountType getTotalCost() {" & @CRLF & _ " return totalCost;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Sets the value of the totalCost property." & @CRLF & _ " * " & @CRLF & _ " * @param value" & @CRLF & _ " * allowed object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public void setTotalCost(AmountType value) {" & @CRLF & _ " this.totalCost = value;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Gets the value of the pendingCost property." & @CRLF & _ " * " & @CRLF & _ " * @return" & @CRLF & _ " * possible object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public AmountType getPendingCost() {" & @CRLF & _ " return pendingCost;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Sets the value of the pendingCost property." & @CRLF & _ " * " & @CRLF & _ " * @param value" & @CRLF & _ " * allowed object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public void setPendingCost(AmountType value) {" & @CRLF & _ " this.pendingCost = value;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Gets the value of the shippingCost property." & @CRLF & _ " * " & @CRLF & _ " * @return" & @CRLF & _ " * possible object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public AmountType getShippingCost() {" & @CRLF & _ " return shippingCost;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Sets the value of the shippingCost property." & @CRLF & _ " * " & @CRLF & _ " * @param value" & @CRLF & _ " * allowed object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public void setShippingCost(AmountType value) {" & @CRLF & _ " this.shippingCost = value;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Gets the value of the groupDiscountsAmount property." & @CRLF & _ " * " & @CRLF & _ " * @return" & @CRLF & _ " * possible object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public AmountType getGroupDiscountsAmount() {" & @CRLF & _ " return groupDiscountsAmount;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Sets the value of the groupDiscountsAmount property." & @CRLF & _ " * " & @CRLF & _ " * @param value" & @CRLF & _ " * allowed object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public void setGroupDiscountsAmount(AmountType value) {" & @CRLF & _ " this.groupDiscountsAmount = value;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Gets the value of the totalNetAmount property." & @CRLF & _ " * " & @CRLF & _ " * @return" & @CRLF & _ " * possible object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public AmountType getTotalNetAmount() {" & @CRLF & _ " return totalNetAmount;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ " /**" & @CRLF & _ " * Sets the value of the totalNetAmount property." & @CRLF & _ " * " & @CRLF & _ " * @param value" & @CRLF & _ " * allowed object is" & @CRLF & _ " * {@link AmountType }" & @CRLF & _ " * " & @CRLF & _ " */" & @CRLF & _ " public void setTotalNetAmount(AmountType value) {" & @CRLF & _ " this.totalNetAmount = value;" & @CRLF & _ " }" & @CRLF & _ "" & @CRLF & _ "}" & @CRLF & _ "" Local $sSubst = "" Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst) MsgBox($MB_SYSTEMMODAL, "Result", $sResult)

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