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
  • 77,832
  • 6
  • 59
  • 90
niz_sh
  • 439
  • 2
  • 5
  • 13

3 Answers3

2

You can use the following regex with lookbehind:

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

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

blhsing
  • 77,832
  • 6
  • 59
  • 90
0

You can use the following regex

[\w-]+(?=")

Demo at regex 101

The Scientific Method
  • 2,266
  • 2
  • 11
  • 23
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
  • 2,934
  • 23
  • 46