0

How to get text inside quote("asd") after value -> "name": like:

"name":"John","name":"1-John", "name":"123", "name":"123","name":"A0-0s".

I need to get all inside quote(""):

John
1-John
123
A0-0s
blhsing
  • 91,368
  • 6
  • 71
  • 106
niz_sh
  • 475
  • 2
  • 5
  • 16

3 Answers3

2

You can use the following regex with lookbehind:

(?<="name":")[^"]+

Demo: https://regex101.com/r/TfkNXE/1

blhsing
  • 91,368
  • 6
  • 71
  • 106
0

You can use the following regex

[\w-]+(?=")

Demo at regex 101

The Scientific Method
  • 2,374
  • 2
  • 14
  • 25
0

The regular expression you can use is: \"name\":\"([a-zA-Z0-9--])+\". Due to the brackets '()' the required result will be present in the first group of the regex match.

However in case you have multiple combinations in a single string like the one you had in the example, remember to use find() or search() method and read more about search and match methods.

Aditya
  • 3,080
  • 24
  • 47