정규 표현식이 모든 일치 항목을 검색할지 아니면 첫번째 일치 항목을 검색할지 지정하는 부울 값(True 또는 False)입니다.
Note:
기본값은 False입니다.
등록정보 사용 설정:
구문: Object.Global= "<True/False>"
예: False로 설정된 글로벌 플래그
Dim regEx, inputStr, result
' Create a new RegExp object
Set regEx = CreateObject("VBScript.RegExp")
' Set the pattern to match the word "cat"
regEx.IgnoreCase = True
regEx.Global = False
regEx.Pattern = "cat"
' Input string
inputStr = "The Cat sat on the cat mat."
' Replace "cat" with "dog"
result = regEx.Replace(inputStr, "dog")
'Now result has the value "The dog sat on the cat mat."
위의 예에서 Global 등록정보는 False로 설정됩니다. 따라서 결과 문자열에는 cat과 dog의 첫번째 인스턴스만 포함됩니다. 전체 입력 문자열을 검색하려면 Global 등록정보를 True로 설정해야 합니다. Global = True를 설정한 이후에는 위의 예제에 대해 "The dog sat on the dog mat" 같은 결과 문자열이 표시됩니다.