First of all I have searched the answer for my query and couldn't find any which using replace() function.
In the following string, Strada Genova 204, 10024 Moncalieri I need to replace comma and the string before it with null, so, the outpt will be just 10024 Moncalieri
I tried $('.class-name').replace(/[^\,]*,(.*)/, "") and didnt work. Changed the regex part several times and nothing worked.
.replace(/[^,]*,/, "")will do? Why capture the rest with(.*)?$('.class-name').text().replace(/.*,/, "")