Regular expressions often look more complicated than they are. It's easy to get lazy, look at a ridiculous string, and just not start. I would spend time emphasizing the need to break them down into their components in order to understand them. Yeah, its work, but that's the job. Sometimes a long regexp is the perfect tool for the job.
I would emphasize simplicity. Find real-world examples in the code you maintain that might have been more easily accomplished with regular expressions. Careful not to be picking on the authors while doing so. It's a tough balance, but these examples will directly speak to practicality and value.
Another tactic I've used in refactoring work is clearly describing how truly complex what they've created is. Any code replacing a complicated regular expression is bound to be complex itself. I get lots of emotional feedback in my refactoring work about "overly complicated code" (read: objects). What they're missing is the complexity in what its replacing. It's just a different complexity, the one they understand (and aren't maintaining so good). Get to the truth of the matter, break down the emotional knee-jerk responses.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||