Regular Expression Anchors: VBScript.RegExp
What is the difference between
$ (End of Line)
and
\Z (End of String)
with 开发者_StackOverflow社区VBScript.RegExp?
Is it simply that a String can have embedded CR + LF and $ sets the scope to what precedes CR + LF?
Or does it not matter when using VBScript.RegExp since this object does not accept files as input?
Thanks.
It makes a difference depending on your flags. If Multiline is active (/m
), $
matches the end of every line (newlines), but \Z
only matches the last position on the string.
A string may contain multiple lines regardless of whether or not if came from a file, for example:
"hello world\nfirefox 4 is out"
See also: Permanent Start of String and End of String Anchors
精彩评论