Java – regular expression – replaces characters (commas) between double quotes if patterns match

I have this log from the exchange server

I use this regular expression to match and group patterns;

Basically, the information in the log is separated by commas Unfortunately, for the "email subject" field, if the user enters a comma, the log will be displayed in double quotation marks, such as the example above - a comma with a date format of "Monday, May 24, 2010"

How to grab commas together with commas without double quotes in a specific group (Group 19)

Solution

You mentioned:

This makes it a CSV file Parsing CSV files is a solved problem. You don't need to reinvent the wheel Use the CSV parser provided by the language library

If you are using Perl, please check the text:: CSV module

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>