Hi… Crystal newbie here… I’m struggling with having to check for
start = 0 if match = text.match(someRegex, start) name = match if b = match.begin output += text[start..b - 1] # ...
I can’t use
match.begin directly because it complains about being type
nil|Int32… even though I’ve already checked that
match is truthy in the first if statement.
Is there any way to ensure
match.begin is not nil when
match is not nil? Alternatively, some type of shorter syntax than having to have multiple if clauses.