In general, I have a hard time understand the REs. I have been looking for good references but none has made them clear for me so far. If anyone knows good resources, let me know. I would really appreciate it.
I was going over a reading material on RE and there are several examples i havent been able to understand
..(0 or 0(1 or 11)0)*.. no occurrence of 111
I think for there to be a match, the input has to contain either 0
or 010
or 0110
or just none (sine *
makes it optional)
The book says the following are matches 0110
101011000010000101
011000011
which i have no objection to because all of them contain at least either one of the three (0
or 010
or 0110
).
However, the book says the following are false 1110
1110110111
0101011111000011
.
The book claims that ..(0 or 0(1 or 11)0)*..
means no occurrence of 111
Can someone explain to me why that is?
0
, or match0
followed one or two1
s, any number of times. This means no occurrence of111
.0
or010
or0110
any number of times but it doesnt say anything about what happens elsewhere does it? like wouldnt it be ok to have0110111
or101011000011100101