How does your regular expression fail?
A first step would be to explain the regular expression and tell us in English words what ([.]?) is supposed to do.
Ideally, describe in English what the complete regular expression should do.
My approach to solving the problem would be to take all parts of a string between double quotes and check each part that it doesn't contain a space. Alternatively, look at all "words" that are delimited with whitespace, and check that they either contain no double quotes or start with a double quote and end with a double quote.
Update: I misread part of the problem:
my "dog shepherd" <-- valid
So that would imply that simply checking for an even number of double quotes is the simplest part.
In reply to Re: validating a quoted string
by Corion
in thread validating a quoted string
by hellosarathy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |