So I got an integer array of 48 elements and I want to check if the array contains a sequence of 1 individual 0.
This array contains such a sequence: 0111101100011
This array doesn’t: 0011110001111
How can I check this in a regular expression in Java?
Try something like:
[^0](0)[^0], or^|[^0](0)[^0]|$to take the edges in account (thanks Sam I am). Note that this will match up to 3 characters, you need to get the position of group 1 of the match to find the position of the actual 0 digit.