简体   繁体   中英

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

Use this pattern:

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

Online Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM