Let's assume I want to match a sentence like :
Home is now behind you, the world is ahead!
this way:
^.*(?<=(H|h)ome).*(w|W)orld.*(\.|!)$
This seems to work fine. (see on regex101)
Now let's assume I'd like to exclude sentences in which the words 'home' and 'world' come in the reverse order:
World is now behind you, the home is ahead!
I tried this (regex101):
^.*(?<!(w|W)orld).*(H|h)ome.*(\.|!)$
This one doesn't work... :-(
Could anyone please explain how to achieve it with negative lookbehinds or by another mean ?...
Positive and negative lookahead/lookbehind depend on your regex processor. Not all processors support this feature.
If I remember correctly, negative lookbehind is seldom implemented.
I have tried your regex at https://regexr.com and it seems to work correctly.