G
Guest
As an example, in VbScript ".*\Rad.DAT" is considered a valid regular expression, but in VB7 and C# I'm getting following error message
parsing ".*\Rad.DAT" - Unrecognized escape sequence \R. Parameter name: .*\Rad.DAT
This is happening for any character that do not have an correspondent escape sequence.
".*\Aad.DAT" is okay because "\a" is an escape sequence
Here is a program sequence that uses VBScript library and consider the mentioned regular expression as a correct one
Dim regex As VBScript_RegExp_55.RegEx
regex = New VBScript_RegExp_55.RegEx
regex.Pattern = ".*\Rad.DAT
regex.IgnoreCase = Tru
regex.Global = Tru
Matches = regex.Execute(sToMatch
This sequence returns an error
TestRE = ".*\Rad.DAT
Dim reg As Rege
'reg = New Regex(TestRE, RegexOptions.IgnoreCase
reg = New Regex(TestRE, RegexOptions.CultureInvariant And RegexOptions.IgnoreCase
'reg = New Regex(TestRE
Dim m As System.Text.RegularExpressions.Matc
m = reg.Match(strToMatch
Thanks
GD
parsing ".*\Rad.DAT" - Unrecognized escape sequence \R. Parameter name: .*\Rad.DAT
This is happening for any character that do not have an correspondent escape sequence.
".*\Aad.DAT" is okay because "\a" is an escape sequence
Here is a program sequence that uses VBScript library and consider the mentioned regular expression as a correct one
Dim regex As VBScript_RegExp_55.RegEx
regex = New VBScript_RegExp_55.RegEx
regex.Pattern = ".*\Rad.DAT
regex.IgnoreCase = Tru
regex.Global = Tru
Matches = regex.Execute(sToMatch
This sequence returns an error
TestRE = ".*\Rad.DAT
Dim reg As Rege
'reg = New Regex(TestRE, RegexOptions.IgnoreCase
reg = New Regex(TestRE, RegexOptions.CultureInvariant And RegexOptions.IgnoreCase
'reg = New Regex(TestRE
Dim m As System.Text.RegularExpressions.Matc
m = reg.Match(strToMatch
Thanks
GD