Back to problems

Split a Log Line by Spaces Outside Quoted Fields

Algorithm · Google · Medium

Quoted-Aware Log Parser Medium · Topics · Company Tags · Hints You are given a log string s. Tokenize it into fields where only spaces that are not inside double quotes serve as delimiters. A space character separates fields only when it appears outside of a pair of double quotes ("). Characters within a quoted region, including spaces, belong to the same field as the surrounding quotes. The double quotes themselves must be kept in the output fields. The input string…

Checking your access…