G
Guest
Hi All
How do you escape a double quote in a Regex? I am having problems with, what should be, a simple regular expression statement. I have a string like (including leading spaces (but thats not my problem))
web_url("ForEx"
and, using the regex
Dim RE_WebURLName As Regex = New Regex(" *web_url\((?<WebURLName>.*),"
I have no problem capturing
"ForEx
The problem is that I want to capture
ForE
that is, I want the string without the enclosing double quotes
I've tried
Dim RE_WebURLName As Regex = New Regex(" *web_url\(\"(?<WebURLName>.*)\","
an
Dim RE_WebURLName As Regex = New Regex(" *web_url\("(?<WebURLName>.*)","
but, in both cases, I get something like this when compiling
error BC30037: Character is not valid
Dim RE_WebURLName As Regex = New Regex(" *web_url\(\"(?<WebURLName>.*)\","
(the tilde is under the '?'
It seems like escaping prior to the double quote is having no effect. What am I doing wrong
Thank
Martin
How do you escape a double quote in a Regex? I am having problems with, what should be, a simple regular expression statement. I have a string like (including leading spaces (but thats not my problem))
web_url("ForEx"
and, using the regex
Dim RE_WebURLName As Regex = New Regex(" *web_url\((?<WebURLName>.*),"
I have no problem capturing
"ForEx
The problem is that I want to capture
ForE
that is, I want the string without the enclosing double quotes
I've tried
Dim RE_WebURLName As Regex = New Regex(" *web_url\(\"(?<WebURLName>.*)\","
an
Dim RE_WebURLName As Regex = New Regex(" *web_url\("(?<WebURLName>.*)","
but, in both cases, I get something like this when compiling
error BC30037: Character is not valid
Dim RE_WebURLName As Regex = New Regex(" *web_url\(\"(?<WebURLName>.*)\","
(the tilde is under the '?'
It seems like escaping prior to the double quote is having no effect. What am I doing wrong
Thank
Martin