I need a javascript regex pattern which can break down a given string into substrings. These substrings will be separated by the comma in the master string, and I want the regex to detect that comma "," and separate or break down the whole master string on the basis of the comma. And make an array of those substrings. If it is possible by any javascript built in method, then it would be appreciated more, Thanks.
Example :
var masterString = "3 Bedrooms, 5 Bathrooms, 10 Dinning rooms, Garden, Kitchen";
var subStrArr = ["3 Bedrooms", "5 Bathrooms", "10 Dinning rooms", "Garden", "Kitchen"];