Practise the standard verbs for testing and fixing tricky regular expressions.
0 / 5 completed
1 / 5
Fill in: 'We ___ a complex regular expression against a visual tool before shipping it, so the actual matched groups are a confirmed fact rather than an assumption.'
We 'test a pattern' — the standard, simple collocation for validating a regex against real input before relying on it. The other options are less idiomatic here.
2 / 5
Fill in: 'Writing a greedy quantifier without thinking through worst-case input can ___ the engine backtracking exponentially on a perfectly ordinary, slightly longer string.'
We say an unchecked greedy pattern will 'leave' the engine backtracking badly — the standard, natural collocation for catastrophic backtracking. The other options aren't idiomatic here.
3 / 5
Fill in: 'We ___ every capture group a clear name in the pattern, so a match result's fields are self-explanatory rather than referenced only by a numeric index.'
We 'give a group a name' — the standard, simple collocation for adding a named capture to a pattern. The other options are less idiomatic here.
4 / 5
Fill in: 'We ___ a pattern against a set of deliberately tricky edge cases, empty strings, unicode and trailing whitespace, not just the one example that inspired writing it.'
We 'run a pattern' — the standard, simple collocation for executing a regex against test input. The other options are less idiomatic here.
5 / 5
Fill in: 'We ___ an overly clever single-line regex into several named, commented steps, since a pattern nobody can read six months later isn't actually maintainable.'
We 'break a regex' — the standard, simple collocation for splitting complex logic into readable pieces. The other options are less idiomatic here.