This is somewhat of a basic question as I'm not very familiar with RegEx but I just cannot find an answer online (it's probably that I don't know what to google for).
I want to write a function that finds all commas that are:
- not between a "]" and a " [" (like in [abc], [def])
- not followed by a "+" (like in abc,+def)
I figured out the individual regex for the two instances are
(?!\\])(\\,)(?!\\s\\[)
and
(\\,)(?!\\+)
(correct me if I'm wrong)
But how do I put the two together in only one command, so that my function will identify all commas that satisfy these two conditions? I'm having some difficulty wrapping my head around it also because they are two negative conditions. If it makes any difference, I'm using R.
Thank you!