Actually, I
didn't know. When googling around, I was surprised to find that I could not track down an example of this question being asked straight up, and answered straight up. I'm
not a Perl wizard, and there are thousands of remarkable tricks and capabilities in the language about which I know nothing.
Several of the responses I got were essentially polite, though not to the point, and I started out by replying to those in a straightforward way. (Yes, I wish I had remembered to add to my original question, "And I don't want to just split the whole line, because that's spectacularly inefficient.") But soon a pattern emerged: A pattern of people bitching at me.
Look at TomDLux's response. It's factually incorrect. Contrary to his assertion my RegEx
does parse consecutive tabs, recognizing them as blank fields. (If it did not, I wouldn't get any captures at all, since the RegEx wouldn't match the string.) But he's so busy lecturing me on style -- as if, had I rendered my example regEx in his Conway-form, it would have been a
more readable example, rather than an
impenetrable one -- that he's lost track of what I asked, and has gone on a fishing trip for reasons to spank me.
As regards BrowserUK, I acknowledged his first comment and explained why that wouldn't work for me, and I acknowledged his second, which had two suggestions. The first suggestion I have addressed in response to another poster, noting that it is indeed the solution of last resort. The second suggestion I had explicitly vetoed in my original question. Nonetheless, I didn't respond with a kneejerk, "RTFQ", which might have been more in tune with the local zeitgeist but which seemed a pointless raise on BUK's not entirely gentle, "A real example would get answers that address the real problem."
I've been writing Perl off and on for about 10 years. This week, for the first time, I became frustrated enough with trying to find out how to do something -- something that, as I said, "should" be trivial but seemed to be impossible -- that I actually signed up here and asked for a reality check. What I got were a set of sometimes well-intentioned but unfortunately off-target responses, some accompanied by jibes and complaints of varying snideness declaiming my rhetorical incompetence.
I responded as one typically does after being subjected to someone else's ego trip.
Now, woe is me, my freshly-minted PM reputation is in the dumpster. Whatever shall I do?
Wait, I know what I'll do. I'll log out, delete the cookies, and return to my status of 72 hours ago: somebody who doesn't log in to PerlMonks. Neither PM nor I will be substantially affected.
Whatever.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.