Amien
Amien

Reputation: 974

Regular expression to find " but not the ones that have ","

I just cant get the hang of regular expressions, trying to find the " , but not the ones with , on either side

I ","can haz ","kittens. "Mmmm". Tasty, tasty kittens.

Thanks in advance

Upvotes: 0

Views: 63

Answers (1)

Andrew Cheong
Andrew Cheong

Reputation: 30273

This:

    (?<!,)"(?!,)

Or, allowing for whitespace:

    (?<!,\s*)"(?!\s*,)

Upvotes: 2

Related Questions