1
I have this json returned by a webservice:
spConfig[92769] = new Product.Config({"attributes":{"152":{"id":"152","code":"color","label":"Cor","options":[{"id":"1777","label":"AZUL-INDIGO","price":"0","oldPrice":"0","products":["92781","92782","92784","92785","92786"]},{"id":"1775","label":"AZUL-MEDIO","price":"0","oldPrice":"0","products":["92795","92796","92797","92798","92799"]}]},"153":{"id":"153","code":"size","label":"Tamanho","options":[{"id":"1807","label":"3\/4 - 104CM","price":"0","oldPrice":"0","products":["92781"]},{"id":"1808","label":"5\/6","price":"0","oldPrice":"0","products":["92782","92795"]},{"id":"1809","label":"7\/8","price":"0","oldPrice":"0","products":["92796"]},{"id":"1810","label":"9\/10","price":"0","oldPrice":"0","products":["92784","92797"]},{"id":"1921","label":"11\/12 - 152CM","price":"0","oldPrice":"0","products":["92785","92798"]},{"id":"1922","label":"13\/14","price":"0","oldPrice":"0","products":["92786","92799"]}]},"168":{"id":"168","code":"leg_size","label":"Tamanho de Perna","options":[{"id":"1785","label":"00","price":"0","oldPrice":"0","products":["92781","92782","92784","92785","92786"]},{"id":"1881","label":"20","price":"0","oldPrice":"0","products":["92795","92796","92797","92798","92799"]}]}},"template":"\u20ac\u00a0#{price}","basePrice":"17.99","oldPrice":"17.99","productId":"92769","chooseText":"Seleccione una opci\u00f3n...","taxConfig":{"includeTax":false,"showIncludeTax":false,"showBothPrices":false,"defaultTax":0,"currentTax":0,"inclTaxTitle":"Impuestos incluidos"},"defaultValues":{"152":"1777","153":"1807","168":"1785"}});
I need to find, for example, 11/12 - 152CM and replace by 11/12, that is, remove the measure in CM and the hyphen, before.
Any hint for regex?
It is only in the attribute "label"?
– Sorack