0
votes
{  
  "response":{  
    "statusCode":"00",
    "status":"success",
            "responseData":{  
                     "status":1,
                     "themeID":27,
                     "themeName":"ThemeName25",
                     "templateId":22
                           }
             }
}

Here i need to retrieve the value of templateId, themeName using regular expression extractor only not by jmeter plugins like json path extractor. Can anyone having for this solution??

2

2 Answers

0
votes

Use the regexen

/"themeName":"([^"]+)"/
/"templateId":([0-9]+)/

to capture the result.

This goes by the usual caveat that it is strongly discouraged to use regex patterns as parser substitutes

One assumption is that values for templateId are structly numeric.

0
votes

To Capture templateId: templateId":(\d+)
To Capture themeName: themeName":"(.+?)"

The special characters above are:
( and ) - these enclose the portion of the match string to be returned
. - match any character
+ - one or more times
? - stop when first match succeeds
\d - for any digit