1

We know that VB string start and end with double quotes " "

So we have to use "" if we want " in VB string.

I wonder if there is a regular expression pattern which will match VB string?.

1
  • What are you trying to accomplish here? String values in Visual Basic do not begin nor end with double-quotes, although double-quotes may be part of a string. Any value in an application can be converted to a string. Commented Mar 15, 2009 at 15:09

2 Answers 2

1

Are you trying to detect if the string they entered would be valid if typed into a VB code file? If so the following regular expression should do the trick

^"(("")|[^"])*"$
Sign up to request clarification or add additional context in comments.

Comments

0

What is the context here? You only need to escape quotes to let the compiler distinguish between start/end quotes and quotes which are part of the string data. If the string is read during runtime there's no need for double quotes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.