I have found the answer for a case which returns the second part of the string, eg:
"qwe_fs_xczv_xcv_xcv_x".replace(/([^\_]*\_){**nth**}/, '');
- where is nth is the amount of occurrence to remove.
If nth=3, the above will return “xcv_xcv_x”
Details in this StackOverflow post: Cutting a string at nth occurrence of a character
How to change the above regular expression to return the first part instead (ie. “qwe_fs_xczv”)?