Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Count Number Of Fields In Quote Qualified Delimited String

littlecatMay 22 2026

I posted question few years ago regarding how to parse tokens from quote qualified (or not) comma delimited string.

I received superb answer from @mathguy Parse Quote Qualified Delimited String - Oracle Forums

I require variation to count number of fields in quote qualified (or not) comma delimited string. The regular expression used as basis of parsing I cannot get quote right for counting.

Rules

  • Fields can be null ie ,X or ,"X" is two fields of 1. null 2. X
  • Quote qualified fields can contain commas, ie ,A,"B","C,D" is four fields of 1. null 2. A 3. B 4. C,D
  • Extreme case: ,A,"B","C,D", is five fields of 1. null 2. A 3. B 4. C,D 5. null

Thanks

This post has been answered by mathguy on May 22 2026
Jump to Answer
Comments
Post Details
Added on May 22 2026
5 comments
219 views