Sebastian Rush
Sebastian Rush

Reputation: 538

RegEx get only specfic character and nothing before/after

I have CSV-line where I want to detect all inner double quotes, no text-qualifier. This works almost fine but my RegEx also detects characters after the double quote.

The CSV-part:

"7580";"Lorem ipsum";"";"Lorem ipsum "I am double quoted" and so on";"<ul class=aclass><li>";"1"

The regex:

/(?<!^)(?<![;])(?:")[^;]/g

Here you can test it: regex-test

Upvotes: 0

Views: 106

Answers (1)

Shafizadeh
Shafizadeh

Reputation: 10340

Use this pattern:

/(?<!^)(?<![;])(?:")(?=[^;])/g

Online Demo

Upvotes: 1

Related Questions