I have this field in my JSON data:
"pinyin": "bei1 'ai1",
I just want to select any single quote ' like the one before ai1;
I tried this
(?<="pinyin": "\w*)\'+(?!")
but it didn't work
I have this field in my JSON data:
"pinyin": "bei1 'ai1",
I just want to select any single quote ' like the one before ai1;
I tried this
(?<="pinyin": "\w*)\'+(?!")
but it didn't work
You can use
(?<="pinyin": "[\w\s]*)'(?!")
See this regex demo. Details:
(?<="pinyin": "[\w\s]*)
- a positive lookbehind that matches a location that is immediately preceded with "pinyin": "
and then any zero or more word or whitespace chars'
- a single quotation mark(?!")
- a negative lookahead that fails the match of there is a "
char immediately to the right of the current location.