-1

Hi I would like to extract the value of group2:

{'group1':'123','group2':'456'}

What I Have:

(?:"group2":")(.*?)(?:")

This extracts the key-value pair with the double quotes. How Can i get only the value without the quotes?

Roger Steinberg
  • 1,430
  • 9
  • 36
  • do you have to use a regex or can you use a dedicated parser? – ti7 May 16 '22 at 17:49
  • unfortunately only regex – Roger Steinberg May 16 '22 at 17:49
  • 1
    You are using double quotes, where there are single quotes. Without the non capture groups it is `'group2':'(.*?)'` and then take the value of capture group 1. Or using a negated character class `'group2':'([^']*)'` See https://regex101.com/r/2APsED/1 – The fourth bird May 16 '22 at 18:04

0 Answers0