J'ai écrit une chose correspondant à une expression régulière, et ce sont les seules fonctions que j'ai utilisées.
Copiez le code comme suit :<%
str = request(str)
reg = request(reg)
set regex = new RegExp
With regex
.Pattern = reg
.IgnoreCase = False
.Global = True
End With
Set match = regex.Execute(str)
Si match.Count > 0 Alors
Pour chaque correspondance dans match
Response.Write <B><input value= & matched.Value & ></B> Position : <B> & matched.FirstIndex & </B>
Longueur
:&matched.Length&<BR>Suivant
Else
Response.Write <B> & regex.Pattern & </B> Aucune correspondance trouvéeEnd
If
Set regex = Nothing
%>
<form method=post >
text :<br>
<textarea cols=50 rows=10 name=str><%=str%></textarea><br>
regexp :<input name=reg value=<%=reg%>><br>
<input type=submit value=regexp>
</form>
À propos des fonctions d'expression régulière spécifiques