mardi 4 août 2015

Regular Expression to match compound words using only the first word

I am trying to create a regular expression in JS which will match the occurences of box and return the full compound word

Using the string:

the box which is contained within a box-wrap has a box-button

I would like to get:

[box, box-wrap, box-button]

Is this possible to match these words only using the string box?

Aucun commentaire:

Enregistrer un commentaire