module

Obelisk::LookAroundUtils

Look-ahead and look-behind utilities

Class methods

extract_balanced_content(text : String, position : Int32, open_char : Char, close_char : Char) : String | Nil

Get the content between balanced delimiters

Source
find_in_window(text : String, position : Int32, window_size : Int32, pattern : Regex) : Array(Regex::MatchData)

Find all occurrences of pattern in look-ahead window

Source
find_matching_close(text : String, position : Int32, open_char : Char, close_char : Char) : Int32 | Nil

Find the matching closing delimiter

Source
inside_balanced?(text : String, position : Int32, open_char : Char, close_char : Char) : Bool

Check if we're inside balanced delimiters

Source
matches_at_offset(text : String, position : Int32, offset : Int32, pattern : Regex) : Bool

Check if pattern matches at specific offset from current position

Source