Task: Matching Up to the First Occurrence of a Character with a Regular Expression
Task: Matching Up to the First Occurrence of a Character with a Regular Expression: a task in Terminal-Lego-15k (Harbor dataset). When using regular expressions, the pattern /^(. );/ is intended to match everything until the first occurrence of a semicolon ( ; ). However, because . is greedy by…
The task
When using regular expressions, the pattern `/^(.*);/` is intended to match everything **until** the first occurrence of a semicolon (`;`). However, because `.*` is **greedy** by default, it actually matches everything up to the **last** semicolon on the line.
Part of PrimeIntellect/Terminal-Lego-15k.