I have a string which represents an address in Javascript, say, "Some address, city, postcode".
I am trying to get the 'postcode' part out.
I want to use the split method for this. I just want to know a regex expression that will find the last occurrence of ' , ' in my string.
I have tried writing expressions such as
address.split("/\,(?=[^,]*$)/");
and
address.split(",(?=[^,]*$)");
But these don't seem to work. Help!