Q:

Really fast Java function to split strings without affecting quoted strings?

I need a string splitting function that is really fast that will break apart a comma delimited string without breaking apart strings encased in double-quotes that contain commas.  Is there a function that does this?  If it's best handled by a regular expression, please indicate the necessary pattern and if applicable, tell me any speed optimization tips I should know about.  For example, if there's a way to invoke the regular expression in such a way that does not require the regular expression pattern to be reevaluated every time, etc.  This function will be called thousands of times in a short period of time.
Note, I did see the regular expression posts on SO like this one:
Regular Expression To Split On Comma Except If Quoted
But they were C# and other languages and not Java.  Also, if there is a non-regular expression method that is faster I'd like to know about it as I indicated above.
-- roschler

A:

It sounds like you are trying to parse a CSV formatted strings/files?
If so, maybe you don't have to write the code yourself. Checkout the apache commons library for CSV parsing:
http://commons.apache.org/sandbox/csv/

