I'm trying to do a specify regex
In php i can do:
'/[lg|sm|md|xs]/'
Will match or lg, or sm, or md or xs once.
On javascript i can't make it work property.
var href = $(this).attr('href');
var t = href.replace('[lg]|[sm]|[md]|[sx]', 'add'); //not working
var t = href.replace('[lg|sm|md|sx]', 'add'); //not working
var t = href.replace('/[lg|sm|md|sx]/', 'add'); //not working
var t = href.replace('/lg|sm|md|sx/', 'add'); //not working
For a URL like:
href="/img/galeria/lg/duplo-standart/foto1.jpg"
All I need is to replace for "lg" on the href and change to "add".
Help is appreciated.