Operator precedence. Basically there is none. It’s all left to right. So the or (|) is applying to the closing quote lookahead and the comma lookahead
Try:
(?:(?<=")([^"]*)(?="))|(?<=,|^)([^,]*)(?=,|$)
More Related Contents:
- How to escape comma and double quote at same time for CSV file?
- How to split a comma separated String while ignoring escaped commas?
- How to split a string if any chracter is found in java
- Splitting a Java String by the pipe symbol using split(“|”)
- How to escape text for regular expression in Java
- Why in Java 8 split sometimes removes empty strings at start of result array?
- Difference between regex [A-z] and [a-zA-Z]
- Java RegEx meta character (.) and ordinary dot?
- CSV API for Java [closed]
- How to remove special characters from a string?
- Splitting string with pipe character (“|”) [duplicate]
- RegEx to split camelCase or TitleCase (advanced)
- Converting JSON to XLS/CSV in Java [closed]
- Compare one String with multiple values in one expression
- Replace the last part of a string
- Generic support for ISO 8601 format in Java 6
- Read CSV file column by column
- How exactly does String.split() method in Java work when regex is provided?
- Check if string ends with certain pattern
- Catastrophic backtracking shouldn’t be happening on this regex
- Character class subtraction, converting from Java syntax to RegexBuddy
- Java regex to match start/end tags causes stack overflow
- Java String.replace/replaceAll not working
- Advanced Wildcard Mappings Parameters not found in Prepare() method
- How to implement a SQL like ‘LIKE’ operator in java?
- Raw Strings in Java – for regex in particular. Multiline strings
- How to replace all characters in a Java string with stars
- How can split a string which contains only delimiter?
- Issue with Java Regex \b
- java regex pattern unclosed character class