Valore booleano (True o False) che specifica se l'espressione regolare non deve distinguere tra maiuscole e minuscole.
Note:
Il valore predefinito è False.
Uso della proprietà Set
Sintassi: Object.IgnoreCase= "<True/False>"
Dim regex, inputText
' Create a new RegExp object
Set regex = CreateObject("VBScript.RegExp")
' Set the pattern and ignore case
regex.Pattern = "apple" ' Pattern to match the word 'apple'
regex.IgnoreCase = True ' Ignore case when matching
' Input text
inputText = "I ate an AppLe today."
' Test if the pattern matches the input text
If regex.Test(inputText) Then
'Match found Logic
Else
'No match found Logic
End If
Il metodo Test controlla se il pattern corrisponde alla stringa, restituendo True perché trova AppLe nel testo, anche se la combinazione di maiuscole e minuscole è diversa. L'impostazione IgnoreCase = True consente di eseguire la ricerca nella stringa non facendo distinzione tra maiuscole e minuscole. Se IgnoreCase = False, il metodo Test esegue una ricerca rigorosa nella stringa apple e restituisce False perché apple non è presente in inputString.