Sélectionner chaîne entre 2 délimiter
Bonjour à tout le monde
Je sèche sur le pb suivant :
j'ai une chaîne comme ça :
Code:
"position: absolute; white-space: nowrap; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Helvetica, sans-serif; font-size: 18px; color: rgb(51, 51, 51); margin-left: 0px; margin-top: 0px; left: 163px; top: 7px;"
Je cherche à sélectionner ce qui se trouve entre "font-family" et le ";" suivant.
j'ai écris le script suivant :
Code:
1 2 3 4
| var expr = "position: absolute; white-space: nowrap; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Helvetica, sans-serif; font-size: 18px; color: rgb(51, 51, 51); margin-left: 0px; margin-top: 0px; left: 163px; top: 7px;"
var reg = /font-family\/((?:.|\n)*?)\;/;
var resultat = expr.match(reg);
alert(resultant); |
Le résultat retourné est toujours ????!!!
Pourquoi ?
Un petit coup de main sera le bienvenu.