|P is for Practical|
Number of bits, length of RegExpby YAFZ (Pilgrim)
|on Apr 21, 2003 at 14:22 UTC||Need Help??|
YAFZ has asked for the wisdom of the Perl Monks concerning the following question:
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?