Valor booliano (True ou False) que especifica se as âncoras ^ e $ correspondem ao início e ao fim de cada linha.
Note:
O valor padrão é False.
Uso da Propriedade:
Sintaxe: Object.Multiline = "<True/False>"
Exemplo:
Dim regEx, inputStr, result
Set regEx = CreateObject("VBScript.RegExp")
' Enable multiline mode
regEx.Multiline = True
' Pattern to match the beginning of each line
regEx.Pattern = "^Hello"
regEx.IgnoreCase = True
' Input string with multiple lines
inputStr = "Hello, world!" & vbCrLf & "This is a test." & vbCrLf & "Hello again!"
' Find all lines that start with "Hello"
result = regEx.Test(inputStr)
If result Then
'Logic Matches at the start of a line.
Else
'Logic Does not match at the start of any line.
End If
Quando a propriedade Multiline está habilitada, as âncoras ^ e $ têm comportamento diferente, correspondendo ao início e ao fim de cada linha, em vez da string inteira. Como Multiline = True no exemplo acima, ^Hello corresponderá a "Hello, world!" e "Hello again!", pois ambas as linhas começam com "Hello".