If you want to return the results to two different arrays that you don't want one regexp unless you also want to do more filtering of the data to know which array to send it to. Two regexp will be easier and probably faster. If you want just one array then can you post some real data examples and explain the data more if necessary because your current description is rather vague.