Regular Expressions 101

Save & Share

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

Code Generator

Generated Code

$re = '/(?siU)^(.*)$/'; $str = '{"id": "40.7143528,-74.0059731", "v3-wx-observations-current": {"cloudCeiling":null,"cloudCoverPhrase":"Partly Cloudy","dayOfWeek":"Saturday","dayOrNight":"N","expirationTimeUtc":1700892390,"iconCode":31,"iconCodeExtend":3100,"obsQualifierCode":"OQ1073","obsQualifierSeverity":1,"precip1Hour":0.00,"precip6Hour":0.00,"precip24Hour":0.00,"pressureAltimeter":30.34,"pressureChange":0.03,"pressureMeanSeaLevel":1027.4,"pressureTendencyCode":1,"pressureTendencyTrend":"Rising","relativeHumidity":48,"snow1Hour":0.0,"snow6Hour":0.0,"snow24Hour":0.0,"sunriseTimeLocal":"2023-11-25T06:54:13-0500","sunriseTimeUtc":1700913253,"sunsetTimeLocal":"2023-11-25T16:31:52-0500","sunsetTimeUtc":1700947912,"temperature":33,"temperatureChange24Hour":-13,"temperatureDewPoint":16,"temperatureFeelsLike":30,"temperatureHeatIndex":33,"temperatureMax24Hour":51,"temperatureMaxSince7Am":51,"temperatureMin24Hour":33,"temperatureWindChill":30,"uvDescription":"Low","uvIndex":0,"validTimeLocal":"2023-11-25T00:56:30-0500","validTimeUtc":1700891790,"visibility":10.000,"windDirection":330,"windDirectionCardinal":"NNW","windGust":null,"windSpeed":4,"wxPhraseLong":"Clear","wxPhraseMedium":"Clear","wxPhraseShort":"Clear"} , "v3-wx-forecast-daily-15day": {"calendarDayTemperatureMax":[51,43,53,53,41,42,48,49,52,52,51,49,46,44,47],"calendarDayTemperatureMin":[33,32,37,38,33,31,34,35,42,41,43,41,39,37,37],"dayOfWeek":["Friday","Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],"expirationTimeUtc":[1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315,1700892315],"moonPhase":["Waxing Gibbous","Waxing Gibbous","Full Moon","Full Moon","Waning Gibbous","Waning Gibbous","Waning Gibbous","Waning Gibbous","Waning Gibbous","Waning Gibbous","Waning Gibbous","Last Quarter","Waning Crescent","Waning Crescent","Waning Crescent"],"moonPhaseCode":["WXG","WXG","F","F","WNG","WNG","WNG","WNG","WNG","WNG","WNG","LQ","WNC","WNC","WNC"],"moonPhaseDay":[12,13,14,15,16,17,18,19,20,21,21,22,23,24,25],"moonriseTimeLocal":["2023-11-24T14:51:00-0500","2023-11-25T15:18:14-0500","2023-11-26T15:50:48-0500","2023-11-27T16:30:19-0500","2023-11-28T17:17:10-0500","2023-11-29T18:12:48-0500","2023-11-30T19:13:41-0500","2023-12-01T20:18:04-0500","2023-12-02T21:21:43-0500","2023-12-03T22:24:55-0500","2023-12-04T23:25:35-0500","","2023-12-06T00:26:14-0500","2023-12-07T01:26:01-0500","2023-12-08T02:28:09-0500"],"moonriseTimeUtc":[1700855460,1700943494,1701031848,1701120619,1701209830,1701299568,1701389621,1701479884,1701570103,1701660295,1701750335,null,1701840374,1701930361,1702020489],"moonsetTimeLocal":["2023-11-24T03:39:11-0500","2023-11-25T04:53:11-0500","2023-11-26T06:07:29-0500","2023-11-27T07:20:26-0500","2023-11-28T08:29:52-0500","2023-11-29T09:30:28-0500","2023-11-30T10:21:58-0500","2023-12-01T11:02:55-0500","2023-12-02T11:35:47-0500","2023-12-03T12:03:01-0500","2023-12-04T12:26:08-0500","2023-12-05T12:46:31-0500","2023-12-06T13:05:27-0500","2023-12-07T13:24:35-0500","2023-12-08T13:45:14-0500"],"moonsetTimeUtc":[1700815151,1700905991,1700996849,1701087626,1701178192,1701268228,1701357718,1701446575,1701534947,1701622981,1701710768,1701798391,1701885927,1701973475,1702061114],"narrative":["A few clouds. Lows overnight in the low 30s.","Times of sun and clouds. Highs in the mid 40s and lows in the upper 30s.","Chance of afternoon showers. Highs in the low 50s and lows in the mid 40s.","A few clouds. Highs in the low 50s and lows in the mid 30s.","Partly cloudy. Highs in the low 40s and lows in the low 30s.","Mix of sun and clouds. Highs in the low 40s and lows in the mid 30s.","Times of sun and clouds. Highs in the upper 40s and lows in the mid 30s.","Partly cloudy. Highs in the upper 40s and lows in the low 40s.","Morning showers. Highs in the low 50s and lows in the low 40s.","Showers possible. Highs in the low 50s and lows in the mid 40s.","Showers. Highs in the low 50s and lows in the low 40s.","Chance of showers. Highs in the upper 40s and lows in the low 40s.","Showers ending by midday. Highs in the mid 40s and lows in the upper 30s.","Times of sun and clouds. Highs in the mid 40s and lows in the upper 30s.","Mix of sun and clouds. Highs in the upper 40s and lows in the mid 30s."],"qpf":[0.0,0.0,0.89,0.0,0.0,0.0,0.0,0.01,0.05,0.44,0.19,0.27,0.06,0.0,0.0],"qpfSnow":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"sunriseTimeLocal":["2023-11-24T06:53:07-0500","2023-11-25T06:54:13-0500","2023-11-26T06:55:17-0500","2023-11-27T06:56:22-0500","2023-11-28T06:57:25-0500","2023-11-29T06:58:27-0500","2023-11-30T06:59:28-0500","2023-12-01T07:00:29-0500","2023-12-02T07:01:29-0500","2023-12-03T07:02:27-0500","2023-12-04T07:03:25-0500","2023-12-05T07:04:22-0500","2023-12-06T07:05:17-0500","2023-12-07T07:06:12-0500","2023-12-08T07:07:05-0500"],"sunriseTimeUtc":[1700826787,1700913253,1700999717,1701086182,1701172645,1701259107,1701345568,1701432029,1701518489,1701604947,1701691405,1701777862,1701864317,1701950772,1702037225],"sunsetTimeLocal":["2023-11-24T16:32:22-0500","2023-11-25T16:31:52-0500","2023-11-26T16:31:24-0500","2023-11-27T16:30:58-0500","2023-11-28T16:30:34-0500","2023-11-29T16:30:13-0500","2023-11-30T16:29:53-0500","2023-12-01T16:29:36-0500","2023-12-02T16:29:22-0500","2023-12-03T16:29:09-0500","2023-12-04T16:28:59-0500","2023-12-05T16:28:51-0500","2023-12-06T16:28:46-0500","2023-12-07T16:28:43-0500","2023-12-08T16:28:42-0500"],"sunsetTimeUtc":[1700861542,1700947912,1701034284,1701120658,1701207034,1701293413,1701379793,1701466176,1701552562,1701638949,1701725339,1701811731,1701898126,1701984523,1702070922],"temperatureMax":[null,44,52,52,41,42,48,49,52,52,51,49,46,44,47],"temperatureMin":[32,37,46,35,31,34,35,42,41,45,41,41,37,37,36],"validTimeLocal":["2023-11-24T07:00:00-0500","2023-11-25T07:00:00-0500","2023-11-26T07:00:00-0500","2023-11-27T07:00:00-0500","2023-11-28T07:00:00-0500","2023-11-29T07:00:00-0500","2023-11-30T07:00:00-0500","2023-12-01T07:00:00-0500","2023-12-02T07:00:00-0500","2023-12-03T07:00:00-0500","2023-12-04T07:00:00-0500","2023-12-05T07:00:00-0500","2023-12-06T07:00:00-0500","2023-12-07T07:00:00-0500","2023-12-08T07:00:00-0500"],"validTimeUtc":[1700827200,1700913600,1701000000,1701086400,1701172800,1701259200,1701345600,1701432000,1701518400,1701604800,1701691200,1701777600,1701864000,1701950400,1702036800],"daypart":[{"cloudCover":[null,19,42,33,88,84,27,14,45,17,38,34,35,22,45,75,70,70,79,83,73,64,71,74,69,43,39,40,34,45],"dayOrNight":[null,"N","D","N","D","N","D","N","D","N","D","N","D","N","D","N","D","N","D","N","D","N","D","N","D","N","D","N","D","N"],"daypartName":[null,"Tonight","Tomorrow","Tomorrow night","Sunday","Sunday night","Monday","Monday night","Tuesday","Tuesday night","Wednesday","Wednesday night","Thursday","Thursday night","Friday","Friday night","Saturday","Saturday night","Sunday","Sunday night","Monday","Monday night","Tuesday","Tuesday night","Wednesday","Wednesday night","Thursday","Thursday night","Friday","Friday night"],"iconCode":[null,33,30,33,39,12,34,31,30,33,30,33,30,33,30,45,39,11,11,11,11,11,11,11,39,45,30,29,30,29],"iconCodeExtend":[null,3300,3000,3300,7103,1200,3400,3100,3000,3300,3000,3300,3000,3300,3000,7100,6103,1100,1100,1100,1100,1100,1100,1100,6103,7100,3000,2900,3000,2900],"narrative":[null,"Generally clear skies. Low 32F. Winds light and variable.","Intervals of clouds and sunshine. High 44F. Winds light and variable.","Mainly clear early, then a few clouds later on. Low 37F. Winds light and variable.","Cloudy in the morning, then off and on rain showers during the afternoon hours. High 52F. Winds ENE at 5 to 10 mph. Chance of rain 60%.","Cloudy with periods of rain. Low 46F. Winds SW at 5 to 10 mph. Chance of rain 100%. Rainfall may reach one inch. Locally heavy rainfall possible.","A few clouds early, otherwise mostly sunny. High 52F. Winds W at 10 to 20 mph.","Clear skies. Low around 35F. Winds W at 10 to 15 mph.","Partly cloudy skies. High 41F. Winds W at 10 to 20 mph.","A few clouds from time to time. Low 31F. Winds W at 10 to 15 mph.","Intervals of clouds and sunshine. High 42F. Winds WSW at 5 to 10 mph.","Mainly clear skies. Low 34F. Winds WSW at 5 to 10 mph.","Intervals of clouds and sunshine. High 48F. Winds W at 5 to 10 mph.","Mostly clear skies. Low around 35F. Winds WNW at 5 to 10 mph.","Partly cloudy. High 49F. Winds light and variable.","Mostly cloudy during the evening. A few showers developing late. Low 42F. Winds light and variable. Chance of rain 30%.","A few showers early with mostly cloudy conditions later in the day. High 52F. Winds light and variable. Chance of rain 40%.","Cloudy with a few showers. Low 41F. Winds N at 5 to 10 mph. Chance of rain 30%.","Considerable cloudiness with occasional rain showers. High 52F. Winds ENE at 5 to 10 mph. Chance of rain 60%.","Cloudy with showers. Low around 45F. Winds NE at 5 to 10 mph. Chance of rain 60%.","Rain showers in the morning becoming more intermittent in the afternoon. High 51F. Winds WNW at 5 to 10 mph. Chance of rain 50%.","Cloudy with occasional rain showers. Low 41F. Winds NW at 5 to 10 mph. Chance of rain 50%.","Cloudy with showers. High 49F. Winds WNW at 5 to 10 mph. Chance of rain 40%.","Overcast with rain showers at times. Low 41F. Winds N at 10 to 15 mph. Chance of rain 60%.","Rain showers early with mostly cloudy conditions later in the day. High 46F. Winds NW at 10 to 15 mph. Chance of rain 40%.","Partly cloudy skies early giving way to a few showers after midnight. Low 37F. Winds NW at 10 to 15 mph. Chance of rain 30%.","Partly cloudy skies. High 44F. Winds WNW at 10 to 15 mph.","Partly cloudy skies. Low 37F. Winds WNW at 5 to 10 mph.","Partly cloudy skies. High 47F. Winds WNW at 5 to 10 mph.","Partly cloudy skies. Low 36F. Winds WNW at 5 to 10 mph."],"precipChance":[null,1,2,4,56,100,8,2,2,1,1,4,4,5,5,34,35,33,58,58,52,45,40,58,43,32,24,20,16,24],"precipType":[null,"precip","rain","precip","rain","rain","rain","precip","rain","precip","rain","precip","rain","precip","rain","rain","rain","rain","rain","rain","rain","rain","rain","rain","rain","rain","rain","precip","rain","precip"],"qpf":[null,0.0,0.0,0.0,0.08,0.81,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.01,0.01,0.04,0.17,0.27,0.09,0.09,0.09,0.17,0.05,0.02,0.0,0.0,0.0,0.0],"qpfSnow":[null,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"qualifierCode":[null,null,null,null,null,"Q5050",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"qualifierPhrase":[null,null,null,null,null,"Locally heavy rainfall possible.",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"relativeHumidity":[null,52,51,61,66,84,65,59,48,51,46,57,53,64,57,70,62,75,72,81,70,71,66,72,64,68,61,66,58,66],"snowRange":[null,"","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"temperature":[null,32,44,37,52,46,52,35,41,31,42,34,48,35,49,42,52,41,52,45,51,41,49,41,46,37,44,37,47,36],"temperatureHeatIndex":[null,35,44,40,52,52,52,44,41,37,42,38,48,42,49,45,52,47,52,48,51,47,49,46,46,41,44,40,47,42],"temperatureWindChill":[null,29,31,34,34,44,39,29,29,25,25,30,30,33,33,40,40,38,38,42,42,38,37,36,36,31,31,32,32,32],"thunderCategory":[null,"No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder"],"thunderIndex":[null,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"uvDescription":[null,"Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low"],"uvIndex":[null,0,2,0,1,0,2,0,2,0,2,0,2,0,2,0,1,0,1,0,1,0,1,0,1,0,2,0,2,0],"windDirection":[null,344,321,312,73,226,273,269,273,281,250,246,273,284,241,230,280,11,71,52,303,321,291,0,316,318,299,297,285,300],"windDirectionCardinal":[null,"NNW","NW","NW","ENE","SW","W","W","W","W","WSW","WSW","W","WNW","WSW","SW","W","N","ENE","NE","WNW","NW","WNW","N","NW","NW","WNW","WNW","WNW","WNW"],"windPhrase":[null,"Winds light and variable.","Winds light and variable.","Winds light and variable.","Winds ENE at 5 to 10 mph.","Winds SW at 5 to 10 mph.","Winds W at 10 to 20 mph.","Winds W at 10 to 15 mph.","Winds W at 10 to 20 mph.","Winds W at 10 to 15 mph.","Winds WSW at 5 to 10 mph.","Winds WSW at 5 to 10 mph.","Winds W at 5 to 10 mph.","Winds WNW at 5 to 10 mph.","Winds light and variable.","Winds light and variable.","Winds light and variable.","Winds N at 5 to 10 mph.","Winds ENE at 5 to 10 mph.","Winds NE at 5 to 10 mph.","Winds WNW at 5 to 10 mph.","Winds NW at 5 to 10 mph.","Winds WNW at 5 to 10 mph.","Winds N at 10 to 15 mph.","Winds NW at 10 to 15 mph.","Winds NW at 10 to 15 mph.","Winds WNW at 10 to 15 mph.","Winds WNW at 5 to 10 mph.","Winds WNW at 5 to 10 mph.","Winds WNW at 5 to 10 mph."],"windSpeed":[null,5,4,5,7,9,13,11,14,12,9,7,9,6,5,5,5,6,7,7,8,9,8,10,11,11,11,9,8,7],"wxPhraseLong":[null,"Mostly Clear","Partly Cloudy","Mostly Clear","PM Showers","Rain","Mostly Sunny","Clear","Partly Cloudy","Mostly Clear","Partly Cloudy","Mostly Clear","Partly Cloudy","Mostly Clear","Partly Cloudy","Showers Late","AM Showers","Showers","Showers","Showers","Showers","Showers","Showers","Showers","AM Showers","Showers Late","Partly Cloudy","Partly Cloudy","Partly Cloudy","Partly Cloudy"],"wxPhraseShort":[null,"M Clear","P Cloudy","M Clear","PM Showers","Rain","M Sunny","Clear","P Cloudy","M Clear","P Cloudy","M Clear","P Cloudy","M Clear","P Cloudy","Shwrs Late","AM Showers","Showers","Showers","Showers","Showers","Showers","Showers","Showers","AM Showers","Shwrs Late","P Cloudy","P Cloudy","P Cloudy","P Cloudy"]}]} , "v3-wx-forecast-hourly-12hour": {"cloudCover":[28,24,9,28,30,33,45,51,57,62,68,61],"dayOfWeek":["Saturday","Saturday","Saturday","Saturday","Saturday","Saturday","Saturday","Saturday","Saturday","Saturday","Saturday","Saturday"],"dayOrNight":["N","N","N","N","N","D","D","D","D","D","D","D"],"expirationTimeUtc":[1700892996,1700892996,1700892996,1700892996,1700892996,1700892996,1700892996,1700894116,1700894116,1700894116,1700894116,1700894116],"iconCode":[33,33,31,33,29,30,30,30,30,28,28,28],"iconCodeExtend":[3300,3300,3100,3300,2900,3000,3000,3000,3000,2800,2800,2800],"precipChance":[1,1,1,1,1,1,1,0,0,0,0,0],"precipType":["precip","precip","precip","precip","precip","precip","precip","precip","precip","precip","rain","rain"],"pressureMeanSeaLevel":[30.35,30.36,30.36,30.37,30.4,30.41,30.42,30.43,30.43,30.42,30.4,30.38],"qpf":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"qpfSnow":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"relativeHumidity":[48,51,53,57,59,61,63,56,51,49,48,45],"temperature":[34,33,33,35,34,34,35,37,38,39,40,42],"temperatureDewPoint":[16,17,18,21,22,22,24,23,21,22,22,22],"temperatureFeelsLike":[28,28,29,30,30,31,35,37,38,39,40,42],"temperatureHeatIndex":[34,33,33,35,34,34,35,37,38,39,40,42],"temperatureWindChill":[28,28,29,30,30,31,35,37,38,39,40,42],"uvDescription":["Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low","Low"],"uvIndex":[0,0,0,0,0,0,0,1,1,2,2,2],"validTimeLocal":["2023-11-25T02:00:00-0500","2023-11-25T03:00:00-0500","2023-11-25T04:00:00-0500","2023-11-25T05:00:00-0500","2023-11-25T06:00:00-0500","2023-11-25T07:00:00-0500","2023-11-25T08:00:00-0500","2023-11-25T09:00:00-0500","2023-11-25T10:00:00-0500","2023-11-25T11:00:00-0500","2023-11-25T12:00:00-0500","2023-11-25T13:00:00-0500"],"validTimeUtc":[1700895600,1700899200,1700902800,1700906400,1700910000,1700913600,1700917200,1700920800,1700924400,1700928000,1700931600,1700935200],"visibility":[10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0],"windDirection":[335,337,340,350,3,17,16,12,18,326,322,321],"windDirectionCardinal":["NNW","NNW","NNW","N","N","NNE","NNE","NNE","NNE","NW","NW","NW"],"windGust":[null,null,null,null,null,null,null,null,null,null,null,null],"windSpeed":[6,5,4,5,4,4,2,3,2,2,2,2],"wxPhraseLong":["Mostly Clear","Mostly Clear","Clear","Mostly Clear","Partly Cloudy","Partly Cloudy","Partly Cloudy","Partly Cloudy","Partly Cloudy","Mostly Cloudy","Mostly Cloudy","Mostly Cloudy"],"wxPhraseShort":["M Clear","M Clear","Clear","M Clear","P Cloudy","P Cloudy","P Cloudy","P Cloudy","P Cloudy","M Cloudy","M Cloudy","M Cloudy"],"wxSeverity":[1,1,1,1,1,1,1,1,1,1,1,1]} , "v3alertsHeadlines": null , "v3-location-point": {"location":{"latitude":40.714,"longitude":-74.002,"city":"New York City","locale":{"locale1":"New York County","locale2":"New York City","locale3":"Manhattan","locale4":"Civic Center"},"neighborhood":"Civic Center","adminDistrict":"New York","adminDistrictCode":"NY","postalCode":"10007","postalKey":"10278:US","country":"United States","countryCode":"US","ianaTimeZone":"America/New_York","displayName":"Manhattan","dstEnd":"2023-11-05T01:00:00-0500","dstStart":"2024-03-10T03:00:00-0400","dmaCd":"501","placeId":"be1886bbc07f760bdf477db5e25d4019bc25a4d616a84e470b22a6dbd1bb198e","disputedArea":false,"disputedCountries":null,"disputedCountryCodes":null,"disputedCustomers":null,"disputedShowCountry":[false],"canonicalCityId":"fc47c333c5d13e34e34c9fdb6e047ceb70f7891e01bc9e1d574b5f93f58aa76d","countyId":"NYC061","locId":"USNY0996:1:US","locationCategory":null,"pollenId":"LGA","pwsId":"KNYNEWYO1018","regionalSatellite":"ne","tideId":"8517847","type":"neighborhood","zoneId":"NYZ212"}} }'; preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 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