cookya
cookya

Reputation: 3307

Regex for string that starts but doesn't end with "

Is there an option to write a regex that represents strings that start with " and don't end with " ?

Upvotes: 7

Views: 5911

Answers (3)

buckley
buckley

Reputation: 14119

Here you go

^".*[^"]$

What regex engine are you using?

Upvotes: 2

dda
dda

Reputation: 6213

There you go:

^".*[^"]$

^" starts with "
.* some chars (or none)
[^"]$ doesn't end with "

Upvotes: 3

codaddict
codaddict

Reputation: 455350

You can use the regex:

^".*[^"]$

Explanation:

^     Start of line anchor
"     A literal "
.*    Any junk
[^"]  Any non " character
$     End of line anchor

Upvotes: 9

Related Questions