regexp question

liunx

Guest
I have a file named bintxt.txt with the binary string representations of the numbers 0 through 600, each on a separate line. <br /><br />When I run the following command (in Linux), I get no results<br />grep '^1*(01)*0*$' bintxt.txt<br /><br />And fittingly, when I run the following command, I get all the lines in the file<br />grep --invert-match '^1*(01)*0*$' bintxt.txt<br /><br />I thought that this regular expression would match lines consisting of any number of 1's followed by any number of 01s followed by any number of 0's (for example, 0,00, 1, 101010, etc would match)<br /><br />Could someone explain why the regular expression is not working as I thought it would?<br /><br /><br /><br />
</div>
 
Top