Multiline 등록정보

^ 및 $ 앵커가 각 행의 시작과 끝과 일치하는지 여부를 지정하는 부울 값(True 또는 False)입니다.

Note:

기본값은 False입니다.

등록정보 사용법:

구문: Object.Multiline = "<True/False>"

예:

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

Multiline이 사용으로 설정된 경우 ^와 $는 전체 문자열이 아닌 각 행의 시작과 끝과 일치하여 다르게 동작합니다. 위의 예에서 Multiline = True 이후 ^Hello는 두 행 모두 "Hello"로 시작하므로 "Hello, world!" 및 "Hello again!"과 일치합니다.