Why does the following regular expression to find all instances EXCEPT abd require a dot at the end of the given pattern to function as intended:
>> regexp({'abc';'abd'},'^(?!abd$)')
ans =
{
[1,1] = [](1x0)
[2,1] = [](1x0)
}
>> regexp({'abc';'abd'},'^(?!abd$).')
ans =
{
[1,1] = 1
[2,1] = [](1x0)
}
This applies in the simpler case without use of a cell as well:
>> regexp('abc','^(?!abd$)')
ans = [](1x0)
>> regexp('abc','^(?!abd$).')
ans = 1