I am looking for a regexp option or trick to capture all possible strings in a regexp when matches can overlap.
Example : /A.A/
in string "ABACADA"
It finds : ABA, ADA
and not ACA
!!
I would like : ABA, ACA, ADA
I am working in PHP, but it can be applied to other languages
preg_match_all('/A.A/',"ABACADA",$matches);
var_dump($matches[0]);
// output : array (size=2)
// 0 => string 'ABA' (length=3)
// 1 => string 'ADA' (length=3)
Can you help me? Thanks
(?=(A.A))
see regex101.com/r/wU8uM7/18