Reputation: 905
I'm trying to write a RegEx that matches the following
"Field1":"Any Content"
But not this
"Field1":""
I've tried
"Field1":".*?"
But it finds matches for ""
Thanks for your help.
Upvotes: 2
Views: 77
Reputation: 149078
Try changing your zero-or-more quantifier (*
) to a one-or-more quantifier (+
):
"Field1":".+?"
You may also want to consider using a character class, like this:
"Field1":"[^"]+"
Upvotes: 5