Regular Expressions 101

Save & Manage Regex

  • Current Version: 1
  • Save & Share
  • Community Library

Flavor

  • PCRE2 (PHP)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java
  • .NET 7.0 (C#)
  • Rust
  • PCRE (Legacy)
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests
Sponsors
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
Processing...

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 = "(?s)(?=\[([-0-9\s:]+)\]\s(\w+)\.(\w+):\s(.+))" Local $sString = "[2021-11-20 01:31:44] prodaction.INFO: Был обновлен статус аренды. (PB GetRental) Данные: {"id":2845,"rental_id":"8f93a037-431b-4a64-b211-5be91689cea9","reservation_id":"","country_id":19,"user_id":1644445545,"number":"9105383799","cost":4,"price":8,"free_quota":15,"timeRemaining":"91:10:10","expiration":"2021-11-23T12:41:55.550771-05:00","maxRentalLifetime":"2021-11-23T12:41:54.665765-05:00","autoRenew":0,"emailReminder":true,"status":"Rented","targets":[{"name":"PNC Bank","price":"8","subId":"70e0dd4a-be1c-49f3-bd59-a8ffe412a804","number":"9105383799","targetId":10205,"renewalPrice":{"amount":4,"currency":{"code":"USD","name":"Dollar","symbol":"$","abbreviation":"USD","stringFormat":"{0:#0.00}"}},"dailyFreeQuota":15}],"isNew":null,"provider":"PB","created_at":"2021-11-16 20:42","updated_at":"2021-11-20 01:31:44","autoRenew_bot":0} " & @CRLF & _ "[2021-11-20 01:31:44] prodaction.INFO: App\Api\PhoneBlur::getRentalActivity | Получен ответ: [" & @CRLF & _ " {" & @CRLF & _ " "lineNumber": "9105383799"," & @CRLF & _ " "lineType": "Temporary Rental"," & @CRLF & _ " "subscriptionItemId": "70e0dd4a-be1c-49f3-bd59-a8ffe412a804"," & @CRLF & _ " "payloadDisplayValue": "951500"," & @CRLF & _ " "fullPayloadValue": "PNC Bank \nYour passcode is 951500.\nDon't share it with anyone. We also won't call and ask for it. If you didn't request this passcode, call us at 1-800-762-2035"," & @CRLF & _ " "isAssignedToSlice": true," & @CRLF & _ " "target": {" & @CRLF & _ " "name": "PNC Bank"," & @CRLF & _ " "searchKeywords": "PNCBank pnc bank"," & @CRLF & _ " "description": null," & @CRLF & _ " "iconUri": "/static/images/targets/icons/pncbank.png"," & @CRLF & _ " "targetId": 10205" & @CRLF & _ " }," & @CRLF & _ " "sentAt": "2021-11-19T17:31:07.153391-05:00"," & @CRLF & _ " "sentFrom": "32858"," & @CRLF & _ " "totalRecords": 0," & @CRLF & _ " "unfilteredSmsSendingAddOnId": null," & @CRLF & _ " "hasUnfilteredSmsSendingAddOn": false" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "lineNumber": "9105383799"," & @CRLF & _ " "lineType": "Temporary Rental"," & @CRLF & _ " "subscriptionItemId": "70e0dd4a-be1c-49f3-bd59-a8ffe412a804"," & @CRLF & _ " "payloadDisplayValue": "435061"," & @CRLF & _ " "fullPayloadValue": "PNC Bank \nYour passcode is 435061.\nDon't share it with anyone. We also won't call and ask for it. If you didn't request this passcode, call us at 1-800-762-2035"," & @CRLF & _ " "isAssignedToSlice": true," & @CRLF & _ " "target": {" & @CRLF & _ " "name": "PNC Bank"," & @CRLF & _ " "searchKeywords": "PNCBank pnc bank"," & @CRLF & _ " "description": null," & @CRLF & _ " "iconUri": "/static/images/targets/icons/pncbank.png"," & @CRLF & _ " "targetId": 10205" & @CRLF & _ " }," & @CRLF & _ " "sentAt": "2021-11-18T08:58:33.486598-05:00"," & @CRLF & _ " "sentFrom": "32858"," & @CRLF & _ " "totalRecords": 0," & @CRLF & _ " "unfilteredSmsSendingAddOnId": null," & @CRLF & _ " "hasUnfilteredSmsSendingAddOn": false" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "lineNumber": "9105383799"," & @CRLF & _ " "lineType": "Temporary Rental"," & @CRLF & _ " "subscriptionItemId": "70e0dd4a-be1c-49f3-bd59-a8ffe412a804"," & @CRLF & _ " "payloadDisplayValue": "553777"," & @CRLF & _ " "fullPayloadValue": "PNC Bank \nYour passcode is 553777.\nDon't share it with anyone. We also won't call and ask for it. If you didn't request this passcode, call us at 1-800-762-2035"," & @CRLF & _ " "isAssignedToSlice": true," & @CRLF & _ " "target": {" & @CRLF & _ " "name": "PNC Bank"," & @CRLF & _ " "searchKeywords": "PNCBank pnc bank"," & @CRLF & _ " "description": null," & @CRLF & _ " "iconUri": "/static/images/targets/icons/pncbank.png"," & @CRLF & _ " "targetId": 10205" & @CRLF & _ " }," & @CRLF & _ " "sentAt": "2021-11-16T13:42:11.646616-05:00"," & @CRLF & _ " "sentFrom": "32858"," & @CRLF & _ " "totalRecords": 0," & @CRLF & _ " "unfilteredSmsSendingAddOnId": null," & @CRLF & _ " "hasUnfilteredSmsSendingAddOn": false" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "lineNumber": "9105383799"," & @CRLF & _ " "lineType": "Temporary Rental"," & @CRLF & _ " "subscriptionItemId": "70e0dd4a-be1c-49f3-bd59-a8ffe412a804"," & @CRLF & _ " "payloadDisplayValue": "676482"," & @CRLF & _ " "fullPayloadValue": "PNC Bank\nYour passcode is 676482.\nDon't share it with anyone. We also won't call and ask for it. If you didn't request this passcode, call us at 1-800-762-2035"," & @CRLF & _ " "isAssignedToSlice": true," & @CRLF & _ " "target": {" & @CRLF & _ " "name": "PNC Bank"," & @CRLF & _ " "searchKeywords": "PNCBank pnc bank"," & @CRLF & _ " "description": null," & @CRLF & _ " "iconUri": "/static/images/targets/icons/pncbank.png"," & @CRLF & _ " "targetId": 10205" & @CRLF & _ " }," & @CRLF & _ " "sentAt": "2021-11-16T12:59:29.093793-05:00"," & @CRLF & _ " "sentFrom": "76200"," & @CRLF & _ " "totalRecords": 0," & @CRLF & _ " "unfilteredSmsSendingAddOnId": null," & @CRLF & _ " "hasUnfilteredSmsSendingAddOn": false" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "lineNumber": "9105383799"," & @CRLF & _ " "lineType": "Temporary Rental"," & @CRLF & _ " "subscriptionItemId": "70e0dd4a-be1c-49f3-bd59-a8ffe412a804"," & @CRLF & _ " "payloadDisplayValue": "3345572"," & @CRLF & _ " "fullPayloadValue": "PNC Text Banking\nYour verification code is 3345572. Please enter this code on the web site to complete the verification.\nReply HELP for help"," & @CRLF & _ " "isAssignedToSlice": true," & @CRLF & _ " "target": {" & @CRLF & _ " "name": "PNC Bank"," & @CRLF & _ " "searchKeywords": "PNCBank pnc bank"," & @CRLF & _ " "description": null," & @CRLF & _ " "iconUri": "/static/images/targets/icons/pncbank.png"," & @CRLF & _ " "targetId": 10205" & @CRLF & _ " }," & @CRLF & _ " "sentAt": "2021-11-16T12:43:39.379496-05:00"," & @CRLF & _ " "sentFrom": "762265"," & @CRLF & _ " "totalRecords": 0," & @CRLF & _ " "unfilteredSmsSendingAddOnId": null," & @CRLF & _ " "hasUnfilteredSmsSendingAddOn": false" & @CRLF & _ " }" & @CRLF & _ "]Код: 200HEADERS: {"url":"https:\/\/www.phoneblur.com\/api\/incoming-temporary-rental-text-messages\/8f93a037-431b-4a64-b211-5be91689cea9","content_type":"application\/json; charset=utf-8","http_code":200,"header_size":760,"request_size":732,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":0.225958,"namelookup_time":4.7e-5,"connect_time":0.016106,"pretransfer_time":0.059616,"size_upload":0,"size_download":3918,"speed_download":17413,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,"starttransfer_time":0.22572,"redirect_time":0,"redirect_url":"","primary_ip":"172.67.223.241","certinfo":[],"primary_port":443,"local_ip":"185.250.205.40","local_port":50942,"http_version":2,"protocol":2,"ssl_verifyresult":0,"scheme":"HTTPS"} " & @CRLF & _ "[2021-11-20 01:42:17] prodaction.INFO: Пользователь пере заказал номер 1807c155-0b8b-4ff3-a042-0a8aa3313e15 по цене 0.1 USD. Пользователю 1966343459 Были сняты средства в размере 0.1 USD." 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