Skip to content

Multi-Line Pattern Matching with Line Continuations #210

Description

@Kingflint

Cannot easily parse multi-line formats with line continuations

Feature Request

pattern = """
Name: {name}
Age: {age:d}
Address: {address:ml} ml = multiline type
"""
Matches:
Name: John
Age: 30
Address: 123 Main St
Apt 4B
City, State

Add :ml multiline type that continues until next pattern match
Support continuation characters (\, ...)
Add MULTILINE flag handling
Handle indentation-based blocks
Support mixed multiline and single-line fields

Test Complexity
Variable indentation
Continuation characters
Empty lines within multiline blocks
Multiple multiline fields
Greedy vs non-greedy multiline matching

Why Complex
Determining where multiline field ends
Handling various continuation styles
Maintaining line number information
Backtracking in multiline context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions