I’ve got a string and want to split it into an array.
I’m not a RegEx guru, but I’ve already tried “\s((?:AND|OR|NOT)\(.*?\))\s”
string:
"free part AND(\"and part\") OR(or part) NOT(\"not part AND\") AND(another and) NOT(\"nospace\") AND(\"not(ugly part)\")"
array:
"free part"
"AND(\"and part\")"
"OR(or part)"
"NOT(\"not part AND\")"
"AND(another and)"
"NOT(\"nospace\")"
"AND(\"not(ugly part)\")"
It’a .NET C# program.
Maybe something along this lines? (I haven’t tested this)
regex:
replacement string: