7.9. Final CommentsI'm sure it's obvious that I'm quite enamored with Perl's regular expressions, and as I noted at the start of the chapter, it's with good reason. Larry Wall, Perl's creator, apparently let himself be ruled by common sense and the Mother of Invention. Yes, the implementation has its warts, but I still allow myself to enjoy the delicious richness of the regex language and the integration with the rest of Perl. However, I'm not a blind fanaticPerl does not offer features that I wish for. Since several of the features I pined for in the first edition of this book were eventually added, I'll go ahead and wish for more here. The most glaring omission offered by other implementations is named capture (˜138). This chapter offers a way to mimic them, but with severe restrictions; it would be much nicer if they were built in. Class set operations (˜125) would also be very nice to have, even though with some effort, they can already be mimicked with lookaround (˜126). Then there are possessive quantifiers (˜142). Perl has atomic grouping, which offers more overall functionality, but still, possessive quantifiers offer a clearer, more elegant solution in some situations. So, I'd like both notations. In fact, I'd also like two related constructs that no flavor currently offers. One is a simple "cut" operator, say Somewhat related to my idea for Finally, as I mentioned on page 337, I think it would be nice to have more control over when embedded code can be interpolated into a regex. Perl is not the ideal regex-wielding language, but it is close, and is always getting better. |