Regexp Matches ignorer occurrence d'un caractère.
Bonjour,
Sub btnMatchMinChars_OnClick me remonte le nombre d'occurrences minuscules trouvés dans MyTextArea.
MyTextArea = "Il y a quoi ce soir à la TV".
J'ai donc 15 occurrences soit: "l y a quoi ce soir la".
J'aimerais ignorer les occurrences "y" et "a".
Une idée?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Sub btnMatchMinChars_OnClick
ValMinChars = "[a-z]"
strText = MyTextArea.Value
Set RegularExpressioN = New RegExp
RegularExpressioN.Pattern = ValMinChars
RegularExpressioN.Global = True
Set matches = RegularExpressioN.Execute(strText)
If matches.Count > 0 Then
msg = "Found " & matches.Count & " matches:" & vbCRLF
MsgBox msg, 0, "VBScript Regular Expression Tester"
Else
MsgBox "No match", 0, "VBScript Regular Expression Tester"
End If
End Sub |