简体   繁体   English

正则表达式仅获得特定字符,前后没有任何内容

[英]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. 我有CSV行,我想在其中检测所有内部双引号,没有文本限定符。 This works almost fine but my RegEx also detects characters after the double quote. 这几乎可以正常工作,但是我的RegEx也可以在双引号之后检测字符。

The CSV-part: CSV部分:

"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 在这里您可以对其进行测试: regex-test

Use this pattern: 使用以下模式:

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

Online Demo 在线演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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