glenn_r
asked on
vb.net regex with single and double quotes not working
m_strRegEx = "^['"]*$"
' the double quote is detected
?Regex.IsMatch(chr(34), m_strRegEx)
' the double quote is not detected when other characters are assigned to the string
?Regex.IsMatch("a" & chr(34), m_strRegEx)
same problem with single quotes
why?
' the double quote is detected
?Regex.IsMatch(chr(34), m_strRegEx)
' the double quote is not detected when other characters are assigned to the string
?Regex.IsMatch("a" & chr(34), m_strRegEx)
same problem with single quotes
why?
ASKER
so whats the test expression look like if i want to find out if the string contains single and/or double quotes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and the $ says the string must have nothing after the quotes.
The * also says that the string can have zero quotes.