How can I write regular expression in which
whenever there is 0000 there should be 1111 after this for example:
00101011000011111111001111010 -> correct
0000110 -> incorect
11110 -> correct
thanks for any help
If you are using Perl, you can use a zero-width negative-lookahead assertion:
The pattern matches if there is a string of
0000not followed by at least four1s. So, a match indicates an incorrect string.Output: