Reputation: 111
How does the regular expression work, so that no " characters are allowed at the beginning and the end of a sentence. Examples:
Test "if" that works --> is allowed
"Test" if that works --> is not allowed
Test if that "works" --> is also not allowed
So the quotes are only allowed in the middle of the sentence.
Upvotes: 0
Views: 131
Reputation: 2981
You'll need to check depending on which language you're using, but you can use the regex '^\"|\"$'
to capture a string with a quotation mark (") at the beginning or end of the string.
Upvotes: 1