For those of you who, like me, make good use of the regular expression tool at regex101.com, you should be aware of the regex engines that it uses:
For PCRE , regex101 compiles its library from PCRE 16-bit library, while PHP uses PCRE 8-bit library, so there are discrepancies in non-UTF mode (see the question below). Other discrepancies are caused by differences in regex101's and PHP's implementation of matching and replacement functions.
Known issue: https://github.com/firasdib/Regex101/issues/216
For Python , regex101 implements it on top of PCRE library, by suppressing features not available in Python. However, there are minor differences which have not been ironed out.
Check the list for known issues.