Here's the regex I'm trying:
/((?<![\\])['"])((?:.(?!(?<![\\])\1))*.?)\1/
This is the text I gave
val1=""val2>"2022-11-16 10:19:20"
I also need a blank expression like val1, i.e. I need something like the following in my contest
"" 2022-11-16 10:19:20
If I change the text to look like below I will get the correct output
val2>"2022-11-16 10:19:20"val1=""
Can anyone tell me what's wrong with me
P粉0644484492024-04-02 15:32:25
Use alternatives to match both cases.
One alternative matches a pair of quotes, another uses lookahead to match the inside of two quotes.
""|(?<=")[^"]+(?=")