### Environment * Python version: 3.12.4 * netutils version: 1.17.2a0 <!-- What did you expect to happen? --> ### Expected Behavior Defining the parent_pattern and child_pattern returns only child lines that are in the parent even if both parent and child are matched. ``` >>> parsed_object.find_children_w_parents(parent_pattern="context local", child_pattern=" logging", match_type="regex") [' logging something', ' logging something else'] ``` <!-- What happened instead? --> ### Observed Behavior Defining the parent_pattern and child_pattern returns everything under the parent. ``` parsed_config.find_children_w_parents(parent_pattern="context local", child_pattern=" logging", match_type="regex") [' something not logging', ' logging something', ' logging something else', ' something else not logging'] ``` <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current release. --> ### Steps to Reproduce ``` >>> from netutils.config.parser import BaseSpaceConfigParser >>> config = '''context local something not logging logging something logging something else something else not logging ''' >>> parsed_object = BaseSpaceConfigParser(config) >>> parsed_config.find_children_w_parents(parent_pattern="context local", child_pattern=" logging", match_type="regex")
Activity