mbstring can be built without mbregex support, in which case these tests would fail. Thus we add respective skip conditions.
Setting the search position immediately behind the last character should be allowed, so we fix this off-by-one error.