mercredi 31 janvier 2018

Ruby Regular Expression match dimensions

Cirque Black Stone Effect Ceramic Floor Tile, Pack of 9, (L)333mm (W)333mm

I've created a block which iterates through a set of results i need to match the length (L)333mm and the width (W)333mm so I can add them to a database.

I've tried a few regular expressions but non of them are working now it feels like i'm just guessing.

product_description = product.at_css('h3 a').text[/\L[0-9\.]+mm/]

gives nil, can you please point me in the right direction

Aucun commentaire:

Enregistrer un commentaire