Q: Regex split by '_', apart from fourth occurrence I may have either of the following strings, and I want to get the associated output:
Input:a_b_c_d_e, expected output: a, b, c, d_e
Input:a_b_c_d, expected output: a, b, c, d
How can I do this with Regex?

A: You may split using this expression:
(?<!^(?:[^_]*_[^_]*){3})_

This matches any underscore apart from that prepended by a string with exactly 3 underscores in it.
Demo: https://ideone.com/VZGv4t
