Regular Expressions 101

Save & Share

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

#include <StringConstants.au3> ; to declare the Constants of StringRegExp #include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate Local $sRegex = ""listItems"\s*:\s*([^}]+)" Local $sString = ""listItems": [" & @CRLF & _ " {" & @CRLF & _ " "name": "Gelas Kaca Lusinan Murah 1 Set Isi 6 Motif Bening Model Klasik Unik Cafe Lucu Cantik Kedaung Coolant Tumblers Harga Murah Tidak Mudah Retak Pecah Bahan Beling Tebal Ukuran 250 ml elegan Untuk Tamu Rumah dan Dapur"," & @CRLF & _ " "nid": "5609668850"," & @CRLF & _ " "icons": []," & @CRLF & _ " "image": "https://id-test-11.slatic.net/p/0227998499138451f7cc6ada1d885a7b.png"," & @CRLF & _ " "originalPrice": "35000.00"," & @CRLF & _ " "originalPriceShow": "Rp35.000"," & @CRLF & _ " "price": "29000.00"," & @CRLF & _ " "promotionId": "null"," & @CRLF & _ " "priceShow": "Rp29.000"," & @CRLF & _ " "discount": "-17%"," & @CRLF & _ " "ratingScore": "0"," & @CRLF & _ " "review": ""," & @CRLF & _ " "installment": ""," & @CRLF & _ " "tItemType": "nt_product"," & @CRLF & _ " "location": "Kota Surabaya"," & @CRLF & _ " "cheapest_sku": "5609668850_ID-11061072628"," & @CRLF & _ " "sku": "5609668850_ID"," & @CRLF & _ " "skus": []," & @CRLF & _ " "brandId": "123222884"," & @CRLF & _ " "brandName": "KEDAUNG"," & @CRLF & _ " "sellerId": "400603179050"," & @CRLF & _ " "mainSellerId": ""," & @CRLF & _ " "sellerName": "Go-Panstore"," & @CRLF & _ " "thumbs": [" & @CRLF & _ " {" & @CRLF & _ " "image": "https://id-test-11.slatic.net/p/0227998499138451f7cc6ada1d885a7b.png"," & @CRLF & _ " "sku": "5609668850_ID"," & @CRLF & _ " "skuId": "11061072628"," & @CRLF & _ " "itemUrl": "/products/gelas-kaca-lusinan-murah-1-set-isi-6-motif-bening-model-klasik-unik-cafe-lucu-cantik-kedaung-coolant-tumblers-harga-murah-tidak-mudah-retak-pecah-bahan-beling-tebal-ukuran-250-ml-elegan-untuk-tamu-rumah-dan-dapur-i5609668850.html"" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "restrictedAge": 0," & @CRLF & _ " "categories": [" & @CRLF & _ " 16336," & @CRLF & _ " 16358," & @CRLF & _ " 16470" & @CRLF & _ " ]," & @CRLF & _ " "clickTrace": "query:gelas+lucu+harga+murah;nid:5609668850;src:LazadaMainSrp;rn:c6e42d21e0c1c781d4df4ad08f2c5705;region:id;sku:5609668850_ID;price:29000.00;client:desktop;supplier_id:400603179050;asc_category_id:16470;item_id:5609668850;sku_id:11061072628;shop_id:2523734"," & @CRLF & _ " "addToCartSkus": [" & @CRLF & _ " {" & @CRLF & _ " "sku": "5609668850_ID-11061072628"," & @CRLF & _ " "skuId": "11061072628"," & @CRLF & _ " "count": 0" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "itemId": "5609668850"," & @CRLF & _ " "skuId": "11061072628"," & @CRLF & _ " "inStock": true," & @CRLF & _ " "isAD": 0," & @CRLF & _ " "addToCart": false," & @CRLF & _ " "showFeedBack": true," & @CRLF & _ " "longImageDisplayable": false," & @CRLF & _ " "itemUrl": "//www.lazada.co.id/products/gelas-kaca-lusinan-murah-1-set-isi-6-motif-bening-model-klasik-unik-cafe-lucu-cantik-kedaung-coolant-tumblers-harga-murah-tidak-mudah-retak-pecah-bahan-beling-tebal-ukuran-250-ml-elegan-untuk-tamu-rumah-dan-dapur-i5609668850.html"," & @CRLF & _ " "querystring": "search=1"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "name": "Gelas Kaca Lusinan Murah 1 Set Isi 6 Motif Bening Model Cawan Unik Cafe Lucu Cantik Merk Kedaung Harga Murah Tidak Mudah Retak Pecah Bahan Beling Tebal Ukuran 250 ml elegan Untuk Tamu Rumah dan Dapur"," & @CRLF & _ " "nid": "5578244948"," & @CRLF & _ " "icons": []," & @CRLF & _ " "image": "https://id-test-11.slatic.net/p/f3c88eb266396b1a132413af364c5e97.png"," & @CRLF & _ " "originalPrice": "35000.00"," & @CRLF & _ " "originalPriceShow": "Rp35.000"," & @CRLF & _ " "price": "25000.00"," & @CRLF & _ " "promotionId": "null"," & @CRLF & _ " "priceShow": "Rp25.000"," & @CRLF & _ " "discount": "-29%"," & @CRLF & _ " "ratingScore": "0"," & @CRLF & _ " "review": ""," & @CRLF & _ " "installment": ""," & @CRLF & _ " "tItemType": "nt_product"," & @CRLF & _ " "location": "Kota Surabaya"," & @CRLF & _ " "cheapest_sku": "5578244948_ID-11032256617"," & @CRLF & _ " "sku": "5578244948_ID"," & @CRLF & _ " "skus": []," & @CRLF & _ " "brandId": "123222884"," & @CRLF & _ " "brandName": "KEDAUNG"," & @CRLF & _ " "sellerId": "400603179050"," & @CRLF & _ " "mainSellerId": ""," & @CRLF & _ " "sellerName": "Go-Panstore"," & @CRLF & _ " "thumbs": [" & @CRLF & _ " {" & @CRLF & _ " "image": "https://id-test-11.slatic.net/p/f3c88eb266396b1a132413af364c5e97.png"," & @CRLF & _ " "sku": "5578244948_ID"," & @CRLF & _ " "skuId": "11032256617"," & @CRLF & _ " "itemUrl": "/products/gelas-kaca-lusinan-murah-1-set-isi-6-motif-bening-model-cawan-unik-cafe-lucu-cantik-merk-kedaung-harga-murah-tidak-mudah-retak-pecah-bahan-beling-tebal-ukuran-250-ml-elegan-untuk-tamu-rumah-dan-dapur-i5578244948.html"" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "restrictedAge": 0," & @CRLF & _ " "categories": [" & @CRLF & _ " 16336," & @CRLF & _ " 16358," & @CRLF & _ " 16470" & @CRLF & _ " ]," & @CRLF & _ " "clickTrace": "query:gelas+lucu+harga+murah;nid:5578244948;src:LazadaMainSrp;rn:c6e42d21e0c1c781d4df4ad08f2c5705;region:id;sku:5578244948_ID;price:25000.00;client:desktop;supplier_id:400603179050;asc_category_id:16470;item_id:5578244948;sku_id:11032256617;shop_id:2523734"," & @CRLF & _ " "addToCartSkus": [" & @CRLF & _ " {" & @CRLF & _ " "sku": "5578244948_ID-11032256617"," & @CRLF & _ " "skuId": "11032256617"," & @CRLF & _ " "count": 0" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "itemId": "5578244948"," & @CRLF & _ " "skuId": "11032256617"," & @CRLF & _ " "inStock": true," & @CRLF & _ " "isAD": 0," & @CRLF & _ " "addToCart": false," & @CRLF & _ " "showFeedBack": true," & @CRLF & _ " "longImageDisplayable": false," & @CRLF & _ " "itemUrl": "//www.lazada.co.id/products/gelas-kaca-lusinan-murah-1-set-isi-6-motif-bening-model-cawan-unik-cafe-lucu-cantik-merk-kedaung-harga-murah-tidak-mudah-retak-pecah-bahan-beling-tebal-ukuran-250-ml-elegan-untuk-tamu-rumah-dan-dapur-i5578244948.html"," & @CRLF & _ " "querystring": "search=1"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "name": "Gelas Kaca Lusinan Murah 1 Set Isi 6 Motif Bening Model WHISKEY Unik Cafe Lucu Cantik Merk Kedaung Harga Murah Tidak Mudah Retak Pecah Bahan Beling Tebal Ukuran 250 ml elegan Untuk Tamu Rumah dan Dapur"," & @CRLF & _ " "nid": "5578230424"," & @CRLF & _ " "icons": []," & @CRLF & _ " "image": "https://id-test-11.slatic.net/p/df5706ad4c4a457e61b6875b1190aad9.png"," & @CRLF & _ " "originalPrice": "48000.00"," & @CRLF & _ " "originalPriceShow": "Rp48.000"," & @CRLF & _ " "price": "39000.00"," & @CRLF & _ " "promotionId": "null"," & @CRLF & _ " "priceShow": "Rp39.000"," & @CRLF & _ " "discount": "-19%"," & @CRLF & _ " "ratingScore": "5.0"," & @CRLF & _ " "review": "2"," & @CRLF & _ " "installment": ""," & @CRLF & _ " "tItemType": "nt_product"," & @CRLF & _ " "location": "Kota Surabaya"," & @CRLF & _ " "cheapest_sku": "5578230424_ID-11032234543"," & @CRLF & _ " "sku": "5578230424_ID"," & @CRLF & _ " "skus": []," & @CRLF & _ " "brandId": "123222884"," & @CRLF & _ " "brandName": "KEDAUNG"," & @CRLF & _ " "sellerId": "400603179050"," & @CRLF & _ " "mainSellerId": ""," & @CRLF & _ " "sellerName": "Go-Panstore"," & @CRLF & _ " "thumbs": [" & @CRLF & _ " {" & @CRLF & _ " "image": "https://id-test-11.slatic.net/p/df5706ad4c4a457e61b6875b1190aad9.png"," & @CRLF & _ " "sku": "5578230424_ID"," & @CRLF & _ " "skuId": "11032234543"," & @CRLF & _ " "itemUrl": "/products/gelas-kaca-lusinan-murah-1-set-isi-6-motif-bening-model-whiskey-unik-cafe-lucu-cantik-merk-kedaung-harga-murah-tidak-mudah-retak-pecah-bahan-beling-tebal-ukuran-250-ml-elegan-untuk-tamu-rumah-dan-dapur-i5578230424.html"" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "restrictedAge": 0," & @CRLF & _ " "categories": [" & @CRLF & _ " 16336," & @CRLF & _ " 16358," & @CRLF & _ " 16470" & @CRLF & _ " ]," & @CRLF & _ " "clickTrace": "query:gelas+lucu+harga+murah;nid:5578230424;src:LazadaMainSrp;rn:c6e42d21e0c1c781d4df4ad08f2c5705;region:id;sku:5578230424_ID;price:39000.00;client:desktop;supplier_id:400603179050;asc_category_id:16470;item_id:5578230424;sku_id:11032234543;shop_id:2523734"," & @CRLF & _ " "addToCartSkus": [" & @CRLF & _ " {" & @CRLF & _ " "sku": "5578230424_ID-11032234543"," & @CRLF & _ " "skuId": "11032234543"," & @CRLF & _ " "count": 0" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "itemId": "5578230424"," & @CRLF & _ " "skuId": "11032234543"," & @CRLF & _ " "inStock": true," & @CRLF & _ " "isAD": 0," & @CRLF & _ " "addToCart": false," & @CRLF & _ " "showFeedBack": true," & @CRLF & _ " "longImageDisplayable": false," & @CRLF & _ " "itemUrl": "//www.lazada.co.id/products/gelas-kaca-lusinan-murah-1-set-isi-6-motif-bening-model-whiskey-unik-cafe-lucu-cantik-merk-kedaung-harga-murah-tidak-mudah-retak-pecah-bahan-beling-tebal-ukuran-250-ml-elegan-untuk-tamu-rumah-dan-dapur-i5578230424.html"," & @CRLF & _ " "querystring": "search=1"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "name": "GODJILLA Gelas Cafe Viral Bahan Kaca Bening Cantik Kedaung Drink Jar Harvest 250 ml Set lengkap dengan tutup Stainless dan gagang Aesthetic Lucu Elegan Harga Termurah"," & @CRLF & _ " "nid": "6413930218"," & @CRLF & _ " "icons": []," & @CRLF & _ " "image": "https://sg-test-11.slatic.net/p/532045a7c119addbf91e6150d2a441b9.png"," & @CRLF & _ " "price": "12690.00"," & @CRLF & _ " "promotionId": "null"," & @CRLF & _ " "priceShow": "Rp12.690"," & @CRLF & _ " "ratingScore": "0"," & @CRLF & _ " "review": ""," & @CRLF & _ " "installment": ""," & @CRLF & _ " "tItemType": "nt_product"," & @CRLF & _ " "location": "Kota Surabaya"," & @CRLF & _ " "cheapest_sku": "6413930218_ID-12164780997"," & @CRLF & _ " "sku": "6413930218_ID"," & @CRLF & _ " "skus": []," & @CRLF & _ " "brandId": "123222884"," & @CRLF & _ " "brandName": "KEDAUNG"," & @CRLF & _ " "sellerId": "400625169008"," & @CRLF & _ " "mainSellerId": ""," & @CRLF & _ " "sellerName": "Godjilla Online Store"," & @CRLF & _ " "thumbs": [" & @CRLF & _ " {" & @CRLF & _ " "image": "https://sg-live-01.slatic.net/p/cdbfe36dca8c1c5a62f84133ece4966c.jpg"," & @CRLF & _ " "sku": "6413930218_ID"," & @CRLF & _ " "skuId": "12164780997"," & @CRLF & _ " "itemUrl": "/products/godjilla-gelas-cafe-viral-bahan-kaca-bening-cantik-kedaung-drink-jar-harvest-250-ml-set-lengkap-dengan-tutup-stainless-dan-gagang-aesthetic-lucu-elegan-harga-termurah-i6413930218.html"" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "restrictedAge": 0," & @CRLF & _ " "categories": [" & @CRLF & _ " 16336," & @CRLF & _ " 16358," & @CRLF & _ " 16470" & @CRLF & _ " ]," & @CRLF & _ " "clickTrace": "query:gelas+lucu+harga+murah;nid:6413930218;src:LazadaMainSrp;rn:c6e42d21e0c1c781d4df4ad08f2c5705;region:id;sku:6413930218_ID;price:12690.00;client:desktop;supplier_id:400625169008;asc_category_id:16470;item_id:6413930218;sku_id:12164780997;shop_id:4388985"," & @CRLF & _ " "addToCartSkus": [" & @CRLF & _ " {" & @CRLF & _ " "sku": "6413930218_ID-12164780997"," & @CRLF & _ " "skuId": "12164780997"," & @CRLF & _ " "count": 0" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "itemId": "6413930218"," & @CRLF & _ " "skuId": "12164780997"," & @CRLF & _ " "inStock": true," & @CRLF & _ " "isAD": 0," & @CRLF & _ " "addToCart": false," & @CRLF & _ " "showFeedBack": true," & @CRLF & _ " "longImageDisplayable": false," & @CRLF & _ " "itemUrl": "//www.lazada.co.id/products/godjilla-gelas-cafe-viral-bahan-kaca-bening-cantik-kedaung-drink-jar-harvest-250-ml-set-lengkap-dengan-tutup-stainless-dan-gagang-aesthetic-lucu-elegan-harga-termurah-i6413930218.html"," & @CRLF & _ " "querystring": "search=1"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "name": "GODJILLA Gelas Cafe Viral Bahan Kaca Bening Cantik 3 pcs Kedaung Drink Jar Harvest 250 ml Set lengkap dengan tutup Stainless dan gagang Aesthetic Lucu Elegan Harga Termurah"," & @CRLF & _ " "nid": "6348904497"," & @CRLF & _ " "icons": []," & @CRLF & _ " "image": "https://sg-test-11.slatic.net/p/d46be3e12d672790397a73b0bb957972.png"," & @CRLF & _ " "originalPrice": "33000.00"," & @CRLF & _ " "originalPriceShow": "Rp33.000"," & @CRLF & _ " "price": "30500.00"," & @CRLF & _ " "promotionId": "null"," & @CRLF & _ " "priceShow": "Rp30.500"," & @CRLF & _ " "discount": "-8%"," & @CRLF & _ " "ratingScore": "0"," & @CRLF & _ " "review": ""," & @CRLF & _ " "installment": ""," & @CRLF & _ " "tItemType": "nt_product"," & @CRLF & _ " "location": "Kota Surabaya"," & @CRLF & _ " "cheapest_sku": "6348904497_ID-12043432935"," & @CRLF & _ " "sku": "6348904497_ID"," & @CRLF & _ " "skus": []," & @CRLF & _ " "brandId": "123222884"," & @CRLF & _ " "brandName": "KEDAUNG"," & @CRLF & _ " "sellerId": "400625169008"," & @CRLF & _ " "mainSellerId": ""," & @CRLF & _ " "sellerName": "Godjilla Online Store"," & @CRLF & _ " "thumbs": [" & @CRLF & _ " {" & @CRLF & _ " "image": "https://sg-test-11.slatic.net/p/d46be3e12d672790397a73b0bb957972.png"," & @CRLF & _ " "sku": "6348904497_ID"," & @CRLF & _ " "skuId": "12043432935"," & @CRLF & _ " "itemUrl": "/products/godjilla-gelas-cafe-viral-bahan-kaca-bening-cantik-3-pcs-kedaung-drink-jar-harvest-250-ml-set-lengkap-dengan-tutup-stainless-dan-gagang-aesthetic-lucu-elegan-harga-termurah-i6348904497.html"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "image": "https://sg-test-11.slatic.net/p/d46be3e12d672790397a73b0bb957972.png"," & @CRLF & _ " "sku": "6348904497_ID"," & @CRLF & _ " "skuId": "12043432934"," & @CRLF & _ " "itemUrl": "/products/godjilla-gelas-cafe-viral-bahan-kaca-bening-cantik-3-pcs-kedaung-drink-jar-harvest-250-ml-set-lengkap-dengan-tutup-stainless-dan-gagang-aesthetic-lucu-elegan-harga-termurah-i6348904497.html"" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "restrictedAge": 0," & @CRLF & _ " "categories": [" & @CRLF & _ " 16336," & @CRLF & _ " 16358," & @CRLF & _ " 16470" & @CRLF & _ " ]," & @CRLF & _ " "clickTrace": "query:gelas+lucu+harga+murah;nid:6348904497;src:LazadaMainSrp;rn:c6e42d21e0c1c781d4df4ad08f2c5705;region:id;sku:6348904497_ID;price:30500.00;client:desktop;supplier_id:400625169008;asc_category_id:16470;item_id:6348904497;sku_id:12043432935;shop_id:4388985"," & @CRLF & _ " "addToCartSkus": [" & @CRLF & _ " {" & @CRLF & _ " "sku": "6348904497_ID-12043432935"," & @CRLF & _ " "skuId": "12043432935"," & @CRLF & _ " "count": 0" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "itemId": "6348904497"," & @CRLF & _ " "skuId": "12043432935"," & @CRLF & _ " "inStock": true," & @CRLF & _ " "isAD": 0," & @CRLF & _ " "addToCart": false," & @CRLF & _ " "showFeedBack": true," & @CRLF & _ " "longImageDisplayable": false," & @CRLF & _ " "itemUrl": "//www.lazada.co.id/products/godjilla-gelas-cafe-viral-bahan-kaca-bening-cantik-3-pcs-kedaung-drink-jar-harvest-250-ml-set-lengkap-dengan-tutup-stainless-dan-gagang-aesthetic-lucu-elegan-harga-termurah-i6348904497.html"," & @CRLF & _ " "querystring": "search=1"" & @CRLF & _ " }" & @CRLF & _ " ]," 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