Finished extractAllPossiblePatternsFromInputLinks function.