Environment
- Python version: 3.12.4
- netutils version: 1.17.2a0
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']
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']
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")
Environment
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.
Observed Behavior
Defining the parent_pattern and child_pattern returns everything under the parent.
Steps to Reproduce