mbstring can be built without mbregex support, in which case these tests would fail. Thus we add respective skip conditions.
That's caused by an off-by-one error, which we fix.