4 ms·
Real-world examples tend to be subtler, and not quite as easy to explain in an introductory article. Of course you wouldn't really use the for-demonstration-onl
by pjscott 14y ago
Real-world examples tend to be subtler, and not quite as easy to explain in an introductory article. Of course you wouldn't really use the for-demonstration-only regex I mentioned. Instead, you would write something reasonable-looking that works just fine unless it encounters a highly unlikely bad input. That's the way I've always seen it happen.
- vampirechicken 14y agoIn the "real world" I usually try to optimize for the average case, and deal with the "highly unlikely bad input" as a special case. I'm still impressed with the new regex engine, but I have a pathological hatred of contrived examples. It's not you, it's me.