in reply to Re^2: split with separators but dont include in the array
in thread split with separators but dont include in the array
No matter how many alternative separators you have, you don't need parentheses at all unless the alternatives are only part of the separator and you need to "factor out" common substrings. For example, if your valid separators were "foo&&", "foo||", and "++", you could split on
/foo(?:&&|\|\|)|++/
|
|---|