Perl Monk, Perl Meditation | |
PerlMonks |
Number of bits, length of RegExpby YAFZ (Pilgrim) |
on Apr 21, 2003 at 14:22 UTC ( [id://252005]=perlquestion: print w/replies, xml ) | Need Help?? |
YAFZ has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
Let's assume that I have a file called bit.txt : And I want two things. 1) The regular expression that matches the lines containing an even number of 1s. 2) The regular expression that matches the lines containing an odd number of 1s. My answer for these: My question is: Are these the shortest possible RegExps for the job? Especially the second one? Can it be shorter?
Back to
Seekers of Perl Wisdom
|
|