Regex for comma-separated values of specific pattern
Given a string such as
cite{AA,BBB, C} skip{DD} cite{EE,F}
, I am trying to extract the comma-separated strings in the specific tag (in this case, named as cite) using Regex.
Thus, the output for the above string should result in
AA
BBB
C
EE
F
I think /cite{(.+?)}/ selects strings in cite{....} form, but how do we then split the string in this output?
I find that some expressions like [^,(?! )]+ split the strings based on comma, but I cannot find a way to couple these two things.
Read more here: Source link
