Hmm...

I need, in Perl, to split a string on whitespace

Unless it is quoted with double-quotes "
Single-quotes ' don't matter

Unless those double-quotes are themselves escaped with a backslash \...

Hmmmmmmmmmmmm

:blobcatthinking: Maybe I could make do with two regexes?

First, use the negative lookbehind, to split on double-quotes unless they're preceded by backslash

Then iterate over the resulting array and split every second element on the whitespaces in it

Then flatten it, I guess

That sounds very inefficient :blobcatoh:

In C, this'd be trivial to solve, I'd just iterate over the string and do the thing

But in Perl? I'm lost :blobcatverysad:

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.