You could probably make the first regex use a non-greedy .*
Wouldn't help.
>perl -E"$_='nor neither nor'; say !/neither.*nor/ && /nor/ ?1:0" 0 >perl -E"$_='nor neither nor'; say !/neither.*?nor/ && /nor/ ?1:0" 0
Non-greediness is very fragile and frequently misused.
In reply to Re^3: regex, use of lookaround for whole word filtering
by ikegami
in thread regex, use of lookaround for whole word filtering
by yonatan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |