The information around multiline in VBScript expressions is a bit inconsistent. The VBScript RegExp object does support them but the property is not well documented.
From Regular Expression Programming (Scripting)
Flags
In the JScript regular expression /abc/gim, the g specifies the global flag, the i specifies the ignore case flag, and the m specifies the multiline flag.
In VBScript, you can specify these flags by setting the equivalent properties to True.
The following table shows the allowed flags.
JScript flag VBScript property If flag is present or property is True
g Global Find all occurrences of the pattern in the searched string
instead of just the first occurrence.
i IgnoreCase The search is case-insensitive.
m Multiline ^ matches positions following a \n or \r, and
$ matches positions before \n or \r.
Whether or not the flag is present or the property is True,
^ matches the position at the start of the searched string,
and $ matches the position at the end of the searched string.
Below is an example of using MultiLine.
Option Explicit
Dim rx: Set rx = New RegExp
Dim matches, match
Dim data: data = Array("This is two lines of text", "This is the second line", "Another line")
Dim txt: txt = Join(data, vbCrLf)
With rx
.Global= True
.MultiLine = True
.Pattern= "line$"
End With
Set matches = rx.Execute(txt)
WScript.Echo "Results:"
For Each match In matches
WScript.Echo match.Value
Next
Output:
Results:
line
line
The difference with MultiLine set to False.
Output:
Results:
line